HTTP methods and HTTP status code.
HTTP methods refer to the action a client wants to perform on a resource (like: Get, Post, Put, Delete)
Get: retrieves data from the server
Post: send data to a server to create a new resource
Put:updates an existing resource on a server
Delete: deletes a resource on a server.
HTTP status code is a number sent by server in response to a request, indicating whether the request was successful or not and providing additional information about the outcome. HTTP status code has the following categories;
. 1XX(informational): Indicates that the request has been received and the server is processing it.
. 2XX( success): The request was successful
.3XX(redirection): Further action is needed to complete the request, like redirecting to a different URL.
.4xx(client error): An error occurred due to the client request, such as a bad URL or invalid credentials
.5XX(server error): An error occurred on the server preventing the request from being fulfilled
HOW HTTP METHODS AND HTTP STATUS CODES WORKS TOGETHER
When a client send a request to a server, the server, the server uses the HTTP method to determine what action to perform. The server sends a response back to the client, which includes an HTTP status code to indicate the outcome of the request.
HTTP method and HTTP status codes are both important part of the web, which allows clients and server to communicate with eachother.
Top comments (0)