DEV Community

Shukroh
Shukroh

Posted on

JavaScript

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.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay