Posts

Showing posts with the label http

Using Sinatra :A Web App Development Library(Part l)

Image
Ruby is blessed with several web application frameworks such as Ruby on Rails , Merb , Nitro,  Camping and Sinatra.Many of us might have heard about Ruby on Rails ,In simple words, Sinatra is an alternative to it and the other frameworks mentioned above.Sinatra was designed and developed by Blake Mizerany in 2007 and named after musician Frank Sinatra. In this article we'll learn about : i.   Installing and Setting up Sinatra ii.  Handling the HTTP Request Prerequisites:  One Must Know Ruby to proceed further. So let's begin : Installing and Setting up Sinatra:   i.  Open the Terminal. ii.   Type "gem install sinatra" without " ". Voila! The gem got install.Now its time to Test it.So, for this we will create  file named "app.rb" and type: require "sinatra" #to use the sinatra module and run the app by typing "ruby /directory_name/app.rb" without ""  and then go t...

Different tools for serving static files through HTTP

Image
Introduction Serving static files through HTTP is not a difficult task. Every little web developer is doing it. But not many people understand the real action that is happening underneath. HTTP protocol is very simple to understand and needs to be understood by everyone as it is one of the most used protocols in the world wide web. Working of HTTP The working of the protocol is very simple. It works on the basis of the request and response. A client (generally a user's browser) makes a request for a particular file and the server it. There are 4 basic types of requests: GET, POST, PUT and DELETE. GET is the most used type of request. When a URL is entered into the browser, the browser makes a GET request to the server. The server serves the required HTML file and the browser renders it. But for this, we need to have a server which is capable of accepting requests and processing them. There are several tools available to make a simple HTTP server. We are going to hav...