-
HTTP is a protocol that allows the fetching of resources, such as HTML documents. It is the foundation of any data exchange on the Web and it is a client-server protocol, which means requests are initiated by the recipient, usually the Web browser.
-
set of rules helps browser and server talk to each other.
-
HTTP Request is made up of three parts:
- Request Line: Contains the request method, the URL, and the HTTP version.
- Request Headers: Contains additional information about the request, such as the browser making the request, the server the request is being made to, and the type of response the browser is expecting. Meta data about the request.
- Request Body: Contains the data that is being sent to the server.
-
HTTP Methods: GET, HEAD, OPTIONS are safe and idempotent methods whereas PUT and DELETE methods are only idempotent. POST and PATCH methods are neither safe nor idempotent.
- GET: Requests data from a specified resource
- POST: Submits data to be processed to a specified resource
- PUT: Updates a specified resource
- DELETE: Deletes a specified resource
- HEAD: Same as GET but does not return a body
- OPTIONS: Returns the supported HTTP methods
- PATCH: Update partial resources
- CONNECT: Establishes a tunnel to the server
- TRACE: Echoes back the received request
-
HTTP Status codes: Link These are the standard codes that refer to the predefined status of the task at the server. Following are the status codes formats available:
- 1xx - represents informational responses
- 2xx - Success
- 3xx - represents redirects
- 4xx - something wrong with out request
- 5xx - something wrong with the server level
- 200 - success/OK
- 201 - CREATED - used in POST or PUT methods.
- 304 - NOT MODIFIED - used in conditional GET requests to reduce the bandwidth use of the network. Here, the body of the response sent should be empty.
- 400 - BAD REQUEST - This can be due to validation errors or missing input data.
- 401- UNAUTHORIZED - This is returned when there is no valid authentication credentials sent along with the request.
- 403 - FORBIDDEN - sent when the user does not have access (or is forbidden) to the resource.
- 404 - NOT FOUND - Resource method is not available.
- 500 - INTERNAL SERVER ERROR - server threw some exceptions while running the method.
- 502 - BAD GATEWAY - Server was not able to get the response from another upstream server.
-
Authentication: Link
-
HTTP caching: Link
-
HTTP cookies: Link