What is an HTTP request?
An HTTP request is made for a client to a host located on
the server in order to receive the resources needed to build the content,
When they make a request, clients we a USL (Uniform Resource
Locator) that contains the information needed to access the server resources
HTTP Message
HTTP message is used to show data is exchanged between the
client and the server. It is based on client-server architecture. An HTTP
client is a program that establishes a connection to a server to send one or
more HTTP requests message.
An HTTP server is a program that accepts. connections to
service HTTP requests by sending an HTTP response message The HTTP message can
be classified as follows:
Message Type
HTTP consists of an initial requests line and an initial
response line.
Format
1 HTTP-message = Request | Response; HTTP/111 message
Initial Request Line - The initial line is different for
the request and for the response. A request line consists of three parts: a
method name, the requested resource's local path, and the HTTP version being used.
All these parts are separated by Spaces.
Syntax
1. Get/path/to/file/index.html/1.0 Here,
·
GET is the most common HTTP method.
·
The path shows the part of the URL after the hostname.
It is called a request URL,
·
The version of HTTP allows takes. the form
"HTTP/x.x", upper care.
2) Initial Response Line
The initial response line is also known as the status line.
It also has three parts: the HTTP version, a response status code that gives
the result of the request, and the English reason phrase describing the status
code.