0% found this document useful (0 votes)
9 views17 pages

HTTP Basics2

The document provides an overview of HTTP request methods, including GET, POST, PUT, DELETE, and others, detailing their functions and expected behaviors. It also categorizes HTTP response status codes into five classes: informational, successful, redirection, client error, and server error, with specific examples for each category. Additionally, it describes various status codes and their meanings, such as 200 OK for successful requests and 404 Not Found for client errors.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views17 pages

HTTP Basics2

The document provides an overview of HTTP request methods, including GET, POST, PUT, DELETE, and others, detailing their functions and expected behaviors. It also categorizes HTTP response status codes into five classes: informational, successful, redirection, client error, and server error, with specific examples for each category. Additionally, it describes various status codes and their meanings, such as 200 OK for successful requests and 404 Not Found for client errors.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

HTTP Request

Methods
1. GET
2. HEAD
3. POST
4. PUT
5. DELETE
6. CONNECT
7. OPTIONS
8. TRACE
9. PATCH
HTTP Request
GET
Methods
The GET method requests a representation of the
specified resource. Requests using GET should
only retrieve data and should not contain a
request content.

HEAD
The HEAD method asks for a response identical to
a GET request, but without a response body.

POST
The POST method submits an entity to the
specified resource, often causing a change in
state or side effects on the server.
HTTP Request
Methods
PUT
The PUT method replaces all current
representations of the target resource with
the request content.

DELETE
The DELETE method deletes the specified
resource.

CONNECT
The CONNECT method establishes a tunnel to
the server identified by the target resource.
HTTP Request
Methods
OPTIONS
The OPTIONS method describes the
communication options for the target
resource.

TRACE
The TRACE method performs a message loop-
back test along the path to the target
resource.

PATCH
The PATCH method applies partial modifications
HTTP response status

codes
HTTP response status codes indicate whether a
specific HTTP request has
1.Informational been successfully
responses
completed.
 Responses(100
are– grouped
199) in five classes
2.Successful responses
(200 – 299)
3.Redirection messages
(300 – 399)
4.Client error responses
(400 – 499)
100 Continue
Informational res
ponses
This interim response indicates that the client should continue
the request or ignore the response if the request is already
finished.
101 Switching Protocols
This code is sent in response to an Upgrade request header
from the client and indicates the protocol the server is
switching to.
102 Processing Deprecated
This code was used in WebDAV contexts to indicate that a
request has been received by the server, but no status was
available at the time of the response.
103 Early Hints
This status code is primarily intended to be used with the Link
header, letting the user agent start preloading resources
while the server prepares a response or preconnect to an
Successful res
ponses
200 OK
The request succeeded

201 Created
The request succeeded, and a new resource was
created as a result

202 Accepted
The request has been received but not yet acted upon
Successful res
203 Non-Authoritative ponses
Information
This response code means the returned metadata is not exactly the same
as is available from the origin server, but is collected from a local or a
third-party copy.

204 No Content
There is no content to send for this request, but the headers are useful.
The user agent may update its cached headers for this resource with
the new ones.

205 Reset Content


Tells the user agent to reset the document which sent this request.

206 Partial Content


This response code is used in response to a range request when the
client has requested a part or parts of a resource.
Successful res
ponses
207 Multi-Status (WebDAV)
Conveys information about multiple resources, for situations where
multiple status codes might be appropriate.

208 Already Reported (WebDAV)


Used inside a <dav:propstat> response element to avoid repeatedly
enumerating the internal members of multiple bindings to the
same collection.

226 IM Used (HTTP Delta encoding)


The server has fulfilled a GET request for the resource, and the
response is a representation of the result of one or more instance-
manipulations applied to the current instance.
Redirection me
ssages
300 Multiple Choices
In agent-driven content negotiation, the request has more than
one possible response and the user agent or user should
choose one of them.

301 Moved Permanently


The URL of the requested resource has been changed
permanently. The new URL is given in the response.

302 Found
This response code means that the URI of requested resource
has been changed temporarily. Further changes in the URI
might be made in the future, so the same URI should be
303 See Other Redirection me
ssages
The server sent this response to direct the client to get
the requested resource at another URI with a GET
request.

304 Not Modified


This is used for caching purposes. It tells the client that
the response has not been modified, so the client can
continue to use the same cached version of the
response.

305 Use Proxy Deprecated


Defined in a previous version of the HTTP specification
to indicate that a requested response must be
accessed by a proxy.
Redirection me
ssages
306 unused
This response code is no longer used; but is reserved.
It was used in a previous version of the HTTP/1.1
specification.

307 Temporary Redirect


The server sends this response to direct the client to
get the requested resource at another URI with the
same method that was used in the prior request.

308 Permanent Redirect


This means that the resource is now permanently
located at another URI, specified by the Location
Client error res
ponses
400 Bad Request
The server cannot or will not process the request due to
something that is perceived to be a client error (e.g.,
malformed request syntax, invalid request )
401 Unauthorized
Although the HTTP standard specifies "unauthorized",
semantically this response means "unauthenticated".
402 Payment Required
The initial purpose of this code was for digital payment
systems, however this status code is rarely used and no
standard convention exists.
403 Forbidden
The client does not have access rights to the content; that is, it
Client error res
ponses
404 Not Found
The server scannot find the requested resource. In the
browser, this means the URL is not recognized.
405 Method Not Allowed
The request method is known by the server but is not
supported by the target resource.
406 Not Acceptable
This response is sent when the web server, after performing
server-driven content negotiation, doesn't find any
content that conforms to the criteria given by the user
agent.
Server error res
ponses
500 Internal Server Error
The server has encountered a situation it does not know
how to handle. This error is generic, indicating that the
server cannot find a more appropriate 5XX status code
to respond with.
501 Not Implemented
The request method is not supported by the server and
cannot be handled. The only methods that servers are
required to support (and therefore that must not return
this code) are GET and HEAD.
502 Bad Gateway
This error response means that the server, while working
as a gateway to get a response needed to handle the
Server error res
ponses
503 Service Unavailable
The server is not ready to handle the request. Common
causes are a server that is down for maintenance or that
is overloaded.
504 Gateway Timeout
This error response is given when the server is acting as a
gateway and cannot get a response in time.
505 HTTP Version Not Supported
The HTTP version used in the request is not supported by
the server.
506 Variant Also Negotiates
The server has an internal configuration error: during
content negotiation, the chosen variant is configured to
Server error res
ponses
507 Insufficient Storage
The method could not be performed on the
resource because the server is unable to store
the representation needed to successfully
complete the request.
508 Loop Detected
The server detected an infinite loop while
processing the request.
510 Not Extended
The client request declares an HTTP Extension (
RFC 2774) that should be used to process the
request, but the extension is not supported.

You might also like