SCRUMble ! Hello Blog Readers! Thank you for all your support and encouragement. I have something exciting for you all. I have recently written and published a new book called 'SCRUMble !'. It is currently available on pothi store. It will be soon available on Amazon and Flipkart as well. Please get your copy and do let me know your reviews. -Abhishek Sathe SCRUMble ! Written and Published by: Abhishek Sathe Distributed by: pothi.com Order your copy now: https://store.pothi.com/book/abhishek-sathe-scrumble/ Coming soon on Amazon and Flipkart About the book: Scrum is a framework for solving complex problems largely adapted by Software Development field. There are multiple ag...
What is HTTP?
HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files (text, graphic images, sound, video, and other multimedia files) on the World Wide Web. As soon as a Web user opens their Web browser, the user is indirectly making use of HTTP. HTTP is an application protocol that runs on top of the TCP/IP suite of protocols (the foundation protocols for the Internet).
Client Server Architecture and HTTP
In Computer science client-server is a software architecture model consisting of two parts, client systems and server systems, both communicating over a computer network or on the same computer. A client-server application is a distributed system made up of both client and server software.
Example
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit">
</form>
TRACE - Performs a message loop-back test along.
HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files (text, graphic images, sound, video, and other multimedia files) on the World Wide Web. As soon as a Web user opens their Web browser, the user is indirectly making use of HTTP. HTTP is an application protocol that runs on top of the TCP/IP suite of protocols (the foundation protocols for the Internet).
Client Server Architecture and HTTP
In Computer science client-server is a software architecture model consisting of two parts, client systems and server systems, both communicating over a computer network or on the same computer. A client-server application is a distributed system made up of both client and server software.
HTTP works as a request-response protocol between a client and server.
A web browser may be the client, and an application on a computer that hosts a web site may be the server.
The client submits an HTTP request message to the server. The server, which provides resources such as HTML files and other content, or performs other functions on behalf of the client, returns a response message to the client. The response contains completion status information about the request and may also contain requested content in its message body.Example
Consider following code snippet from a HTML file:
Note that, the method attribute specifies how to send form-data (the form-data is sent to the page specified in the action attribute).
<form action="demo_form.asp" method="get">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit">
</form>
Note that query strings (name/value pairs) are sent in the URL of a GET request:
/test/demo_form.asp?name1=value1&name2=value2
So in our example above, upon running the code if we enter “abhishek” as fname and “sathe” as lname then the name - value pairs in the query string URL would be:
fname=abhishek&lname=sathe
HTTP methods
The set of common methods for HTTP/1.1 is defined below. These method names are case sensitive and they must be used in uppercase.
GET- The GET method is used to retrieve information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data.
HEAD - Same as GET, but transfers the status line and header section only.
POST - A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms.
PUT - Replaces all current representations of the target resource with the uploaded content.
DELETE - Removes all current representations of the target resource given by a URI.
CONNECT - Establishes a tunnel to the server identified by a given URI.
OPTIONS - Describes the communication options for the target resource.
TRACE - Performs a message loop-back test along.
***************GET****************
A GET request retrieves data from a web server by specifying parameters in the URL portion of the request. This is the main method used for document retrieval.
- Get requests can be cached.
HTTP Caching:
Fetching something over the network is both slow and expensive: large responses require many roundtrips between the client and server, which delays when they are available and can be processed by the browser, and also incurs data costs for the visitor. As a result, the ability to cache and reuse previously fetched resources is a critical aspect of optimizing for performance.
Refer http://www.ebaytechblog.com/2012/08/20/caching-http-post-requests-and-responses/ for more information about HTTP caching.
- GET requests remain in the browser history
Parameters remain in browser history because they are part of the URL.
- GET requests can be bookmarked.
An HTTP POST can be bookmarked, but since a bookmark only consists of the URL, all of the form parameters will be lost. This will often mean that the web server doesn't know what to do with the request, since it was expecting some form parameters.
If you submit a form via a GET request, all of the form parameters go into the URL (after the ?), so a bookmark will contain all of the information needed for the webserver to rebuild the page a second time (except for cookies, perhaps, but a webserver is more likely to handle that gracefully)
- GET requests should never be used when dealing with sensitive data
When you use GET method, the data will be sent to the server as query parameters. These are appended to the URL as a key value pair. These values will be visible at the address bar. URL character length is limited, so you cannot use it if you are sending large data. GET is recommended to use for querying information from server, kind of search operations. GET requests should never be used when dealing with sensitive data – Refer http://www.java2novice.com/java_interview_questions/http-get-post/#sthash.8QWOp2cI.dpuf for more information.
- GET requests have length restrictions
The limit is dependent on both the server and the client used (and if applicable, also the proxy the server or the client is using).
Most webservers have a limit of 8192 bytes (8KB), which is usually configurable somewhere in the server configuration. As to the client side matter, the HTTP 1.1 specification even warns about this.
********************POST*********************
A POST request is used to send data to the server, for example customer information, file upload etc. using HTML forms. Note that query strings (name/value pairs) are sent in the HTTP message body of a POST request. For example:
POST /test/demo_form.asp HTTP/1.1
Host: w3schools.com
name1=value1&name2=value2
Host: w3schools.com
name1=value1&name2=value2
- POST requests are never cached
- POST requests do not remain in the browser history
- POST requests cannot be bookmarked
- POST requests have no restrictions on data length************************************************Using Firebug to understand HTTP requests:Add add-on of Firebug in Mozilla Firefox and after successful installation you will get a button on browser like below:Firebug integrates with Firefox to put a wealth of web development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.To start firebug, click on the icon and see that it will glow:To demonstrate, you can go to yahoo.com and then enter computer research as a search string. Then start firebug and select Net tab. Then search for your results and the results looks like this:
Comments
Post a Comment