What Is HTTP? Hypertext Transfer Protocol- Get The Full Details
What Is HTTP? Hyper Text Transfer Protocol- Get The Full Details
Hypertext Transfer Protocol ( HTTP) .
Is a network protocol used to deliver virtually all files and other data (collectively called resources) on the World Wide Web, whether they’re HTML files, image files, query results, or whatever else. Generally , HTTP takes place through TCP/IP sockets.
And a browser is an HTTP client because it sends requests to an HTTP server (Web server), which in return sends responses back to the client. The standard (and default) port for HTTP servers is 80, though they can use any port.
Hypertext Transfer Protocol ( HTTP)- is used to transmit resources, not just files.
A resource is chunks of information that can be identified by a URL it’s the R in URL. The most common kind of resource is a file, but it may also be a generated query result, the output of a CGI script, a document that is available in several languages, or other forms of information.
The Form of HTTP Transactions
HTTP uses the client-server model: An HTTP client opens a connection and sends a request message to an HTTP server; that server then returns a response message, usually containing the resource that was requested.
Once the response is delivered, the server closes the connection-making HTTP a stateless protocol, i.e. not maintaining any connection information between requests.
The format of the request and response messages are similar, mainly English-oriented and Both kinds of messages consist of:
- zero or more header lines,
- an initial line,
- a blank line (i.e. a CRLF by itself). Plus…
- an optional message body (e.g. a file, or query data, or query output).
In another way, the format of an HTTP message is:
<initial line, different for request vs. response> Header1: value1 Header2: value2 Header3: value3 <optional message body goes here, like file contents or query data; it can be many lines long, or even binary data $&*%@!^$@>
The Initial lines and headers should end in CRLF, though you should handle lines ending in just LF. To be More exactly- CR and LF here mean (ASCII) values 13 and 10, even though some platforms may use different characters,
The initial request line is different for the request than for the response. A request line has three parts, separated by spaces: a method name, the local path of the requested resource, and the version of HTTP being used. A request line would look like this:
GET /path/to/file/index.html HTTP/1.0
1- (GET)- is the most common HTTP method; it says “give me this resource”. Other methods may include POST and HEAD.
Method names are always uppercase.
2- The path is the part of the URL after the host name, also called the request URI – a URI is like a URL, but more general.
3- The HTTP version always takes the form “HTTP/x.x“, (uppercase).
You can learn more about http by clicking here
Hope this was of great help, if I can further help you please drop me your questions in the box below.