SlideShare a Scribd company logo
`UNIT I: MESSAGE FORMAT
MESSAGE FORMAT:
Earlier:
• HTTP is a request-response protocol.
It specifies a set of rules that clients and servers use to
communicate:
• An HTTP server process is created on a port (80), which waits
for clients to establish a TCP connection.
• An HTTP client initiates a TCP connection with the HTTP
server at the designated port.
• The HTTP server accepts this connection.
• The HTTP client then sends a request for a resource to the
server.
• Upon receiving the request, the server processes the request,
performs the desired task, and sends a response back to the
client.
• The HTTP server closes the TCP connection.
• The HTTP client receives the response containing information
and processes it.
HTTP STATELESS:
• HTTP client wants to get resource from the server, it has
to follow these steps.
• Web server treats every request as a new request.
• There is no way to specify that some requests are
related.
ADVANTAGE:
• Client/Server need not retain information between
successive requests.
• It is successive related requests is sometimes necessary.
• As HTTP protocol is inherently stateless, designer of the
web pages must use alternative methods such as
Cookies, URL rewriting, etc.
Web technology Unit-I  Part D - message format
HTTP Message
Request
Message
Response
Message
Types:
Web technology Unit-I  Part D - message format
REQUEST MESSAGE:
A request message is sent by a web client to the web server.
• Request Line
• Header
• Empty Line
• Optional Body
HTTP REQUEST MESSAGE FORMAT:
Request line
Header
Empty line
Body (available for some messages)
EXAMPLE:
REQUEST LINE:
• Request Type
• URL
• HTTP Version
Two consecutive parts are separated by a space.
SYNTAX:
Request
Type
URL
HTTP
Version
Space
HTTP REQUEST LINE EXAMPLE:
REQUEST TYPE (METHOD):
• It indicates the type of the request, a client wants to send.
• A method makes a message either a request or a command
to the server.
• Request messages are used to retrieve data from the server.
• A command tells the server to do a specific task.
Fields/
Methods
Description
GET It 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 It 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.
PATCH This is similar to PUT method except that if specifies a list of
differences that must be applied on the existing file.
COPY The HTTP protocol used to copy a file from one location to
another. URL specified in the request line specifies the location
of the source file and is specified in the entity header. Then
must be property to accept the COPY method.
Fields/
Methods
Description
MOVE It is similar to the COPY method except that it deletes the
source file. The location of the source file is specified by
the URL in the request line and the location of the target
file.
DELETE It is used to remove a document from the server and
deleted is specified by a URL in the request line.
LINK It is used to create a link or links from one document to
another. The URL in the request line specifies the location
of the source file and the entity header and location of
target document.
UNLINK It is used to remove a link or links created by the LINK
method.
Fields/
Methods
Description
OPTIONS It is used to retrieve the set of methods supported by the
server and used to check whether a server is functioning
properly before performing other tasks.
CONNECT It is used to convert a request connection into the
transparent TCP/IP tunnel and facilitate Secured Socket
Layer (SSL) encrypted communication through an
unencrypted HTTP proxy server.
TRACE It is used to instruct the web server to echo the request
back to the client and then see what additions or changes
are done by the immediate servers.
Methods
Fields /
Methods
Description Safe
GET • They are used to retrieve information from
the server.
• They can’t change the state of the server and
don’t have any harmful side effects except
certain harmless effects such as caching,
logging, etc.
Yes
HEAD Yes
OPTIONS Yes
TRACE Yes
Methods
Fields /
Methods
Description Unsafe
DELETE • They may change the state of the server.
• These methods have harmful side effects
and hence are vulnerable.
• Sensitive web servers are usually not
configured to accept these methods.
Yes
MOVE Yes
UNLINK Yes
URL:
Studied in previous section.
HTTP VERSION:
• HTTP/1.0
• HTTP/1.1 – it is current version.
Web technology Unit-I  Part D - message format
RESPONSE METHOD:
In response to the request message, a response message is sent
by a server to the client.
• A status line
• A header
• An empty line
• An optional body
HTTP RESPONSE MESSAGE FORMAT:
Status line
Header
Empty line
Body (available for some messages)
STATUS LINE:
• HTTP version
• Status code
• Status phrase
Two consecutive parts are separated by a space.
SYNTAX:
HTTP
Version
Status
code
Status
phrase
Space
EXAMPLE OF HTTP RESPONSE LINE:
EXAMPLE:
HTTP VERSION:
This field specifies the version of the HTTP protocol being
used by the server.
Current Version: HTTP/1.1
STATUS CODE:
• It is a three-digit code that indicates the status of the
response.
• They are classified with respect to their functionality into
five groups:
3-Digit
Code
Name Description
1xx series Informational • This class of status codes represents
provisional responses.
2xx series Success • This class of status codes indicates that the
client’s request are received, understood,
and accepted successfully.
3xx Redirectional • It indicates additional actions must be taken
by the client to complete the request.
• The user agent make actions in order to
fulfill the request automatically, provided it
uses either HEAD or GET method.
3-Digit
Code
Name Description
4xx Client error • They are used to indicate the client request
had an error and therefore it can’t be
fulfilled.
• Except for the HEAD method, the body of
the response message contains explanation
that caused the error.
• The user agent should display the error
message to inform the server.
3-Digit
Code
Name Description
5xx Server error • It indicates the server encountered some
problem and request can’t be satisfied at
this time.
• The reason of the failure is embedded in the
message body.
• It is also indicated whether failure is
temporary or permanent.
• The user agent should display a message
on the screen to make the user aware of the
server failure.
HTTP STATUS CODE:
1xx series – Information
Status code Status phrase Description
100 Continue The server has received the request
headers and the client can continue further
sending the request body where required.
Example:
A client can to send the request body for
POST method. In way client can avoid
sending a large message body if request is
already rejected.
101 Switching The server switches the protocol on
receiving a request from the client to do the
same.
102 Processing The server has received the request which
is currently under process and no response
is available yet.
2xx series – Success
Status code Status phrase Description
200 Ok The request is OK.
201 Created The request is complete, and a new
resource is created .
202 Accepted The request is accepted for processing,
but the processing is not complete.
203 Non-Authoritative
Information
The information in the entity header is
from a local or third-party copy, not from
the original server.
204 No Content A status code and a header are given in
the response, but there is no entity-body
in the reply
205 Reset Content The browser should clear the form used
for this transaction for additional input.
Status code Status phrase Description
206 Partial Content The server is returning partial data of
the size requested. Used in response to
a request specifying a Range header.
The server must specify the range
included in the response with
the Content-Range head
207 Multi-Status The body of the message is an XML file
that contains a number of response
codes. The number of response codes
depends on the number of sub-requests
made.
3xx series – Redirection
Status code Status phrase Description
300 Multiple Choices A link list. The user can select a link and
go to that location. Maximum five
addresses .
301 Moved Permanently The requested page has moved to a new
URL.
302 Found The requested page has moved
temporarily to a new URL.
303 See Other The requested page has moved
temporarily to a new URL.
304 Not Modified This is the response code to an If-
Modified-Since or If-None-
Match header, where the URL has not
been modified since the specified date.
4xx series – Client Error
Status code Status phrase Description
400 Bad Request The server did not understand the
request.
401 Unauthorized The requested page needs a
username and a password.
403 Forbidden Access is forbidden to the requested
page.
404 Not Found The server can not find the requested
page.
405 Method Not Allowed The method specified in the request is
not allowed.
406 Not Acceptable The server can only generate a
response that is not accepted by the
client.
408 Request Timeout The request took longer than the
server was prepared to wait.
Status
code
Status phrase Description
409 Conflict The request could not be completed
because of a conflict.
410 Gone The requested page is no longer
available.
411 Length Required The "Content-Length" is not defined.
The server will not accept the request
without it.
412 Precondition Failed The precondition given in the request
evaluated to false by the server.
413 Request Entity Too Large The server will not accept the request,
because the request entity is too large.
414 Request-URI Too Long The URI specified was too long for this
server to process.
415 Unsupported Media Type The server doesn’t support the media
type specified.
Status
code
Status phrase Description
416 Requested Range Not
Satisfiable
The requested byte range is not
available and is out of bounds.
417 Expectation Failed The expectation given in an Expect
request-header field could not be met
by this server.
422 Unprocessable Entity The request contains semantic errors
and can’t be fullfilled.
423 Locked The requested resource is locked.
424 Failed Dependency The request has failed due to the
failure of the previous request.
5xx series – Server Error
Status code Status phrase Description
500 Internal Server Error The request was not completed. The
server met an unexpected condition.
501 Not Implemented The request was not completed. The
server did not support the functionality
required.
502 Bad Gateway The request was not completed. The
server received an invalid response
from the upstream server.
503 Service Unavailable The request was not completed. The
server is temporarily overloading or
down.
504 Gateway Timeout The gateway has timed out.
505 HTTP Version Not
Supported
The server does not support the "http
protocol" version.
Web technology Unit-I  Part D - message format
Web technology Unit-I  Part D - message format
HEADERS:
• They are important part of both request message and response
message.
• The characteristics of the resource requested and the data that are
provided.
Example:
• A client may want to accept image files only in some specified format.
• Similarly, the server may provide additional information about the
resource being sent such as the length of message content or last
modification date of the resource, etc.
• The headers are separated by an empty line from the request and
response body.
HTTP REQUEST HEADER FORMAT:
Request Header contains of three parts:
General Header
Request Header
Entity Header
HTTP RESPONSE HEADER FORMAT:
Response Header contains of three parts:
General Header
Response Header
Entity Header
• A header consists of single line or multiple lines.
• Each line is a single header form:
• It is not a case-sensitive; but header value may be.
• If header line starts with a space, it is considered to be a part
of previous header line.
Header-name: Header value
Example:
• If a long header value is broken into multiple lines.
Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC
1123
SYNTAX:
Header
name:
Header
value
Space(s)
Web technology Unit-I  Part D - message format
GENERAL HEADERS:
They are present in both request and response message, but have somewhat
different meaning in each.
REQUEST HEADER:
It contains information about client sending the request as well as the
data format that the client expects.
Web technology Unit-I  Part D - message format
RESPONSE HEADER:
It contains the information about the server and the data being sent.
ENTITY HEADER:
It is present in both request and response message and information
about the message body.
Web technology Unit-I  Part D - message format
REFERENCE:
https://www.slideshare.net/origamiaddict/http-40249449
https://www.httpdebugger.com/http/http_header.html

More Related Content

What's hot (20)

PDF
Cs8591 u4
Kathirvel Ayyaswamy
 
PPTX
IP Address - IPv4 & IPv6
Adeel Rasheed
 
PPTX
Data link layer
Mukesh Chinta
 
PPTX
Protocols and the TCP/IP Protocol Suite
Atharaw Deshmukh
 
PPTX
Computer network switching
Shivani Godha
 
PPT
TCP congestion control
Shubham Jain
 
PPT
Chapter 6
Faisal Mehmood
 
PPTX
Internet Protocol
Jayesh Chauhan
 
PDF
2.6 ethernet ieee 802.3
JAIGANESH SEKAR
 
PPT
Shared memory
Abhishek Khune
 
PPT
2. data and signals
Humayoun Kabir
 
PPTX
Arp (address resolution protocol)
tigerbt
 
PPTX
Mobile Transport layer
Pallepati Vasavi
 
PPTX
Tcp/ip model
Kumar Alok
 
PPTX
Elementary TCP Sockets
Saksham Khurana
 
PPTX
Unit 4-Transport Layer Protocols.pptx
sarosh32
 
PPTX
Csma cd and csma-ca
kazim Hussain
 
PPTX
MEDIUM ACCESS CONTROL
junnubabu
 
PPTX
TCP- Transmission Control Protocol
Akhil .B
 
IP Address - IPv4 & IPv6
Adeel Rasheed
 
Data link layer
Mukesh Chinta
 
Protocols and the TCP/IP Protocol Suite
Atharaw Deshmukh
 
Computer network switching
Shivani Godha
 
TCP congestion control
Shubham Jain
 
Chapter 6
Faisal Mehmood
 
Internet Protocol
Jayesh Chauhan
 
2.6 ethernet ieee 802.3
JAIGANESH SEKAR
 
Shared memory
Abhishek Khune
 
2. data and signals
Humayoun Kabir
 
Arp (address resolution protocol)
tigerbt
 
Mobile Transport layer
Pallepati Vasavi
 
Tcp/ip model
Kumar Alok
 
Elementary TCP Sockets
Saksham Khurana
 
Unit 4-Transport Layer Protocols.pptx
sarosh32
 
Csma cd and csma-ca
kazim Hussain
 
MEDIUM ACCESS CONTROL
junnubabu
 
TCP- Transmission Control Protocol
Akhil .B
 

Similar to Web technology Unit-I Part D - message format (20)

PPTX
HTTP
vaibhavrai1993
 
PPTX
Http
NITT, KAMK
 
PPT
HyperText Transfer Protocol
ponduse
 
PDF
21 HTTP Protocol #burningkeyboards
Denis Ristic
 
PPTX
HTTP Request Header and HTTP Status Code
Abhishek L.R
 
PPT
Hyper text transport protocol
HarshithaAllu
 
PDF
HTTP Request and Response Structure
BhagyashreeGajera1
 
PPTX
Hypertex transfer protocol
wanangwa234
 
PDF
Introduction to HTTP
Seble Nigussie
 
PPTX
HTTP Protocol Basic
Chuong Mai
 
PPTX
Week3 lec 1
syedhaiderraza
 
PPTX
hhtp (3).pptx hyper text transfer protocol
abhinandpk2405
 
PPT
Http request&response by Vignesh 15 MAR 2014
Navaneethan Naveen
 
PPTX
Http Introduction
Akshay Dhole
 
PPT
Http VS. Https
Raed Aldahdooh
 
PDF
HTTP(Hyper Text Transfer Protocol)
Jyothishmathi Institute of Technology and Science Karimnagar
 
PDF
Communicating on the web
Adrian Cardenas
 
PDF
Ch2 the application layer protocols_http_3
Syed Ariful Islam Emon
 
PPTX
BITM3730Week9(1).pptx
MattMarino13
 
HyperText Transfer Protocol
ponduse
 
21 HTTP Protocol #burningkeyboards
Denis Ristic
 
HTTP Request Header and HTTP Status Code
Abhishek L.R
 
Hyper text transport protocol
HarshithaAllu
 
HTTP Request and Response Structure
BhagyashreeGajera1
 
Hypertex transfer protocol
wanangwa234
 
Introduction to HTTP
Seble Nigussie
 
HTTP Protocol Basic
Chuong Mai
 
Week3 lec 1
syedhaiderraza
 
hhtp (3).pptx hyper text transfer protocol
abhinandpk2405
 
Http request&response by Vignesh 15 MAR 2014
Navaneethan Naveen
 
Http Introduction
Akshay Dhole
 
Http VS. Https
Raed Aldahdooh
 
Communicating on the web
Adrian Cardenas
 
Ch2 the application layer protocols_http_3
Syed Ariful Islam Emon
 
BITM3730Week9(1).pptx
MattMarino13
 
Ad

More from SSN College of Engineering, Kalavakkam (20)

PDF
Localization, Classification, and Evaluation.pdf
SSN College of Engineering, Kalavakkam
 
PPTX
Database Management System - 2a
SSN College of Engineering, Kalavakkam
 
PPTX
Database Management System
SSN College of Engineering, Kalavakkam
 
PPTX
Unit III - Inventory Problems
SSN College of Engineering, Kalavakkam
 
PPTX
Unit II B - Game Theory
SSN College of Engineering, Kalavakkam
 
PPTX
Unit II A - Game Theory
SSN College of Engineering, Kalavakkam
 
PPTX
Unit V - Queuing Theory
SSN College of Engineering, Kalavakkam
 
PPTX
Unit IV-Project Management
SSN College of Engineering, Kalavakkam
 
PPTX
Web technology Unit-II Part-C
SSN College of Engineering, Kalavakkam
 
PPTX
Data structure Unit-I Part-C
SSN College of Engineering, Kalavakkam
 
PPTX
Data structure unit I part B
SSN College of Engineering, Kalavakkam
 
PPTX
Web technology Unit-II Part A
SSN College of Engineering, Kalavakkam
 
PPTX
Data structure Unit-I Part A
SSN College of Engineering, Kalavakkam
 
Ad

Recently uploaded (20)

PPTX
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PPTX
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPTX
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
Horarios de distribución de agua en julio
pegazohn1978
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
Dimensions of Societal Planning in Commonism
StefanMz
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 

Web technology Unit-I Part D - message format

  • 2. MESSAGE FORMAT: Earlier: • HTTP is a request-response protocol. It specifies a set of rules that clients and servers use to communicate:
  • 3. • An HTTP server process is created on a port (80), which waits for clients to establish a TCP connection. • An HTTP client initiates a TCP connection with the HTTP server at the designated port. • The HTTP server accepts this connection. • The HTTP client then sends a request for a resource to the server. • Upon receiving the request, the server processes the request, performs the desired task, and sends a response back to the client. • The HTTP server closes the TCP connection. • The HTTP client receives the response containing information and processes it.
  • 4. HTTP STATELESS: • HTTP client wants to get resource from the server, it has to follow these steps. • Web server treats every request as a new request. • There is no way to specify that some requests are related.
  • 5. ADVANTAGE: • Client/Server need not retain information between successive requests. • It is successive related requests is sometimes necessary. • As HTTP protocol is inherently stateless, designer of the web pages must use alternative methods such as Cookies, URL rewriting, etc.
  • 9. REQUEST MESSAGE: A request message is sent by a web client to the web server. • Request Line • Header • Empty Line • Optional Body
  • 10. HTTP REQUEST MESSAGE FORMAT: Request line Header Empty line Body (available for some messages)
  • 12. REQUEST LINE: • Request Type • URL • HTTP Version Two consecutive parts are separated by a space.
  • 14. HTTP REQUEST LINE EXAMPLE:
  • 15. REQUEST TYPE (METHOD): • It indicates the type of the request, a client wants to send. • A method makes a message either a request or a command to the server. • Request messages are used to retrieve data from the server. • A command tells the server to do a specific task.
  • 16. Fields/ Methods Description GET It 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 It 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. PATCH This is similar to PUT method except that if specifies a list of differences that must be applied on the existing file. COPY The HTTP protocol used to copy a file from one location to another. URL specified in the request line specifies the location of the source file and is specified in the entity header. Then must be property to accept the COPY method.
  • 17. Fields/ Methods Description MOVE It is similar to the COPY method except that it deletes the source file. The location of the source file is specified by the URL in the request line and the location of the target file. DELETE It is used to remove a document from the server and deleted is specified by a URL in the request line. LINK It is used to create a link or links from one document to another. The URL in the request line specifies the location of the source file and the entity header and location of target document. UNLINK It is used to remove a link or links created by the LINK method.
  • 18. Fields/ Methods Description OPTIONS It is used to retrieve the set of methods supported by the server and used to check whether a server is functioning properly before performing other tasks. CONNECT It is used to convert a request connection into the transparent TCP/IP tunnel and facilitate Secured Socket Layer (SSL) encrypted communication through an unencrypted HTTP proxy server. TRACE It is used to instruct the web server to echo the request back to the client and then see what additions or changes are done by the immediate servers.
  • 19. Methods Fields / Methods Description Safe GET • They are used to retrieve information from the server. • They can’t change the state of the server and don’t have any harmful side effects except certain harmless effects such as caching, logging, etc. Yes HEAD Yes OPTIONS Yes TRACE Yes
  • 20. Methods Fields / Methods Description Unsafe DELETE • They may change the state of the server. • These methods have harmful side effects and hence are vulnerable. • Sensitive web servers are usually not configured to accept these methods. Yes MOVE Yes UNLINK Yes
  • 22. HTTP VERSION: • HTTP/1.0 • HTTP/1.1 – it is current version.
  • 24. RESPONSE METHOD: In response to the request message, a response message is sent by a server to the client. • A status line • A header • An empty line • An optional body
  • 25. HTTP RESPONSE MESSAGE FORMAT: Status line Header Empty line Body (available for some messages)
  • 26. STATUS LINE: • HTTP version • Status code • Status phrase Two consecutive parts are separated by a space.
  • 28. EXAMPLE OF HTTP RESPONSE LINE:
  • 30. HTTP VERSION: This field specifies the version of the HTTP protocol being used by the server. Current Version: HTTP/1.1
  • 31. STATUS CODE: • It is a three-digit code that indicates the status of the response. • They are classified with respect to their functionality into five groups:
  • 32. 3-Digit Code Name Description 1xx series Informational • This class of status codes represents provisional responses. 2xx series Success • This class of status codes indicates that the client’s request are received, understood, and accepted successfully. 3xx Redirectional • It indicates additional actions must be taken by the client to complete the request. • The user agent make actions in order to fulfill the request automatically, provided it uses either HEAD or GET method.
  • 33. 3-Digit Code Name Description 4xx Client error • They are used to indicate the client request had an error and therefore it can’t be fulfilled. • Except for the HEAD method, the body of the response message contains explanation that caused the error. • The user agent should display the error message to inform the server.
  • 34. 3-Digit Code Name Description 5xx Server error • It indicates the server encountered some problem and request can’t be satisfied at this time. • The reason of the failure is embedded in the message body. • It is also indicated whether failure is temporary or permanent. • The user agent should display a message on the screen to make the user aware of the server failure.
  • 35. HTTP STATUS CODE: 1xx series – Information Status code Status phrase Description 100 Continue The server has received the request headers and the client can continue further sending the request body where required. Example: A client can to send the request body for POST method. In way client can avoid sending a large message body if request is already rejected. 101 Switching The server switches the protocol on receiving a request from the client to do the same. 102 Processing The server has received the request which is currently under process and no response is available yet.
  • 36. 2xx series – Success Status code Status phrase Description 200 Ok The request is OK. 201 Created The request is complete, and a new resource is created . 202 Accepted The request is accepted for processing, but the processing is not complete. 203 Non-Authoritative Information The information in the entity header is from a local or third-party copy, not from the original server. 204 No Content A status code and a header are given in the response, but there is no entity-body in the reply 205 Reset Content The browser should clear the form used for this transaction for additional input.
  • 37. Status code Status phrase Description 206 Partial Content The server is returning partial data of the size requested. Used in response to a request specifying a Range header. The server must specify the range included in the response with the Content-Range head 207 Multi-Status The body of the message is an XML file that contains a number of response codes. The number of response codes depends on the number of sub-requests made.
  • 38. 3xx series – Redirection Status code Status phrase Description 300 Multiple Choices A link list. The user can select a link and go to that location. Maximum five addresses . 301 Moved Permanently The requested page has moved to a new URL. 302 Found The requested page has moved temporarily to a new URL. 303 See Other The requested page has moved temporarily to a new URL. 304 Not Modified This is the response code to an If- Modified-Since or If-None- Match header, where the URL has not been modified since the specified date.
  • 39. 4xx series – Client Error Status code Status phrase Description 400 Bad Request The server did not understand the request. 401 Unauthorized The requested page needs a username and a password. 403 Forbidden Access is forbidden to the requested page. 404 Not Found The server can not find the requested page. 405 Method Not Allowed The method specified in the request is not allowed. 406 Not Acceptable The server can only generate a response that is not accepted by the client. 408 Request Timeout The request took longer than the server was prepared to wait.
  • 40. Status code Status phrase Description 409 Conflict The request could not be completed because of a conflict. 410 Gone The requested page is no longer available. 411 Length Required The "Content-Length" is not defined. The server will not accept the request without it. 412 Precondition Failed The precondition given in the request evaluated to false by the server. 413 Request Entity Too Large The server will not accept the request, because the request entity is too large. 414 Request-URI Too Long The URI specified was too long for this server to process. 415 Unsupported Media Type The server doesn’t support the media type specified.
  • 41. Status code Status phrase Description 416 Requested Range Not Satisfiable The requested byte range is not available and is out of bounds. 417 Expectation Failed The expectation given in an Expect request-header field could not be met by this server. 422 Unprocessable Entity The request contains semantic errors and can’t be fullfilled. 423 Locked The requested resource is locked. 424 Failed Dependency The request has failed due to the failure of the previous request.
  • 42. 5xx series – Server Error Status code Status phrase Description 500 Internal Server Error The request was not completed. The server met an unexpected condition. 501 Not Implemented The request was not completed. The server did not support the functionality required. 502 Bad Gateway The request was not completed. The server received an invalid response from the upstream server. 503 Service Unavailable The request was not completed. The server is temporarily overloading or down. 504 Gateway Timeout The gateway has timed out. 505 HTTP Version Not Supported The server does not support the "http protocol" version.
  • 45. HEADERS: • They are important part of both request message and response message. • The characteristics of the resource requested and the data that are provided. Example: • A client may want to accept image files only in some specified format. • Similarly, the server may provide additional information about the resource being sent such as the length of message content or last modification date of the resource, etc. • The headers are separated by an empty line from the request and response body.
  • 46. HTTP REQUEST HEADER FORMAT: Request Header contains of three parts: General Header Request Header Entity Header
  • 47. HTTP RESPONSE HEADER FORMAT: Response Header contains of three parts: General Header Response Header Entity Header
  • 48. • A header consists of single line or multiple lines. • Each line is a single header form: • It is not a case-sensitive; but header value may be. • If header line starts with a space, it is considered to be a part of previous header line. Header-name: Header value Example: • If a long header value is broken into multiple lines. Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
  • 51. GENERAL HEADERS: They are present in both request and response message, but have somewhat different meaning in each.
  • 52. REQUEST HEADER: It contains information about client sending the request as well as the data format that the client expects.
  • 54. RESPONSE HEADER: It contains the information about the server and the data being sent.
  • 55. ENTITY HEADER: It is present in both request and response message and information about the message body.