KEMBAR78
HTTPRequest Response | PDF
0% found this document useful (0 votes)
8 views3 pages

HTTPRequest Response

HTTP, or Hypertext Transfer Protocol, is the foundation for communication between a client and a server, where the client sends requests for resources. An HTTP request consists of a request line, request headers, and an optional body, while the server responds with a status line, response headers, and a response body containing the requested resource or error information. This protocol facilitates the exchange of data over the web by defining how requests and responses should be structured and processed.

Uploaded by

bijeshsharma2016
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

HTTPRequest Response

HTTP, or Hypertext Transfer Protocol, is the foundation for communication between a client and a server, where the client sends requests for resources. An HTTP request consists of a request line, request headers, and an optional body, while the server responds with a status line, response headers, and a response body containing the requested resource or error information. This protocol facilitates the exchange of data over the web by defining how requests and responses should be structured and processed.

Uploaded by

bijeshsharma2016
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

What is HTTP?

It stands for hypertext transfer protocol. Using this protocol the


client sends a request to the server and based on the request the
server and the web browser respond to the client.
In a nutshell, we can say that it’s the base using which one
computer (the client) communicates with another (the server)

HTTP request

Once the connection is established using the Http


protocol between client and server, the client then sends a
request in the form of binary data to the server asking to access
specific files or information from the server.

What’s actually inside the request

Every HTTP request contains three elements which are:- Request


Line, Request Header, Body of Request(optional).
Request line:-

1. It specifies the method, which tells the server what to do


with the information or resource.
2. It contains the URL of the request which is used to find the
resource on the server.
3. It also specifies HTTP protocol version being used (Ex. HTTP/
1.0 or HTTP/1.1)

Request Header:- It consists of 0 or more headers.


1. The headers are used to pass more information about the
request so that using the request headers the server knows
how to deal with the information the client is demanding.
2. I.e What should be the language of content to be displayed,
what should be the content-type that client demands.
Request Body:-
1. This is an optional part of the HTTP request which is used to
send additional data to the server

HTTP Response
The response from the server with the target to provide the client
with the desired resources is HTTP Response.

Ok now let’s look inside the Response from the server:-


Status line:- HTTP/1.1 302 Found This is how the status line of
the response header looks like. It contains the HTTP protocol
version, status code, Reason phrase (known as status text).
Response Header:- There can be one or more response header
lines and they are used to pass additional information to the client
from the server.
Response Body:- The response body contains the resource
demanded by the client. If the request is unsuccessful then the
response body contains the reason for the error, it may also
contain the steps to be done by the client to complete the request
successfully.

You might also like