HTTP essentials

HTTP stands for Hypertext Transfer Protocol, and it is used for exchanging documents (referred to as hypertext) over the internet. A hypertext is a text with links (hyperlinks) to other documents. HTTP provides a set of verbs for specifying the operations that we need to perform on a resource, and a set of response codes that the server can return to the client.

The following HTTP verbs (methods) are generally used with REST APIs: GET, for retrieving data; HEAD, for getting the header (similar to GET, but without the body); POST, for non-idempotent requests (for example, creating an ID); PUT, for idempotent requests (for example, override updates); PATCH, for partial updates; and DELETE, for deleting resources. OPTIONS is generally used for CORS pre-flight requests. 

HTTP response codes are generally categorized as follows: 1xx for information, 2xx for success, 3xx for redirection, 4xx for client errors, and 5xx for server errors. The most commonly used codes are 200 (Success), 404 (Resource Not Found), 500 (Unhandled Internal Server Error), and so on. There is no hard rule on what a server can do when it receives an HTTP method or what response codes it can return, but the preceding are some general guidelines.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.69.163