Logo

dev-resources.site

for different kinds of informations.

HTTP Methods, Status Codes and their meaning

Published at
12/20/2020
Categories
httpmethods
get
post
statuscodes
Author
sai_karthik
Categories
4 categories in total
httpmethods
open
get
open
post
open
statuscodes
open
Author
11 person written this
sai_karthik
open
HTTP Methods, Status Codes and their meaning

Have you ever wondered what's the difference between GET and POST requests, or what does 404 Not Found means? You're not alone. Having a basic understanding of the different HTTP Methods and HTTP Status Codes is important when you're exploring and testing APIs.

HTTP Methods:

Below are some common HTTP methods. Let's discuss what each of them means.

GET:

GET method is used to retrieve data from a server at the specified resource.
GET is often the default method in HTTP clients

POST:

POST requests are used to send data to the API server to create or update a resource. The data sent to the server is stored in the request body of the HTTP request.
The simplest example is a contact form on a website. When you fill out the inputs in a form and hit Send, that data is put in the response body of the request and sent to the server.

PUT:

Similar to POST, PUT requests are used to send data to the API to update or create a resource. The difference is that PUT requests are idempotent. That is, calling the same PUT request multiple times will always produce the same result. In contrast, calling a POST request repeatedly make have side effects of creating the same resource multiple times.

PATCH:

PATCH is used for modifying capabilities. The PATCH request only needs to contain the changes to the resource, not the complete resource.
This resembles PUT, but the body contains a set of instructions describing how a resource currently residing on the server should be modified to produce a new version. This means that the PATCH body should not just be a modified part of the resource, but in some kind of patch languages like JSON Patch or XML Patch.

DELETE:

DELETE is pretty easy to understand. It is used to delete a resource identified by a URI.

HTTP Response Status Codes:

HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped into five classes. Let's touch upon some most common HTTP response status codes from all these classes in this blog.

  • Informational responses (100โ€“199)
  • Successful responses (200โ€“299)
    200 OK: The request was completed successfully.

  • Redirects (300โ€“399)
    301 Moved Permanently: The resource is permanently located in a different URI. A new URI should be given in the response.
    302 Found: The resource temporarily moved to a new location.

  • Client errors (400โ€“499)
    400 Bad Request: The request could not be understood by the server.
    401 Unauthorized: The request has not been applied because it lacks valid authentication credentials for the target resource.
    403 Forbidden: User not authorized to perform the requested operation.
    404 Not Found: The requested resource could not be found at the given URI.
    405 Method Not Allowed: The request method is not allowed on the specified resource.

  • Server errors (500โ€“599)
    500 Internal Server Error: The server encountered an unexpected condition, preventing it to fulfill the request.
    503 Service Unavailable: The server is temporarily unavailable, usually due to overloading or maintenance.
    504 Gateway Timeout: The server is a gateway or proxy server, and it is not receiving a response from the backend servers within the allowed time period.

Further References:

Here are some resources where you can refer to more of these HTTP Methods and HTTP Response Status Codes.
MDN - HTTP Methods
MDN - HTTP Response Status Codes

statuscodes Article's
27 articles in total
Favicon
important status code to be known as API developer
Favicon
HTTP Status Code
Favicon
HTTP Status code a software developer should know.
Favicon
Why I don't include 404's when designing API's
Favicon
Understanding Response Status Codes in Django REST Framework
Favicon
Understanding HTTP, HTTPS, and Status Codes: A Simple Guide
Favicon
Understanding HTTP Status Codes: A Simple Guide with Real-Life Scenarios
Favicon
HTTP Status Codes: Your Guide to Web Communication and Error Handling ๐ŸŒ
Favicon
Understanding the Basics of HTTP Status Codes
Favicon
The HTTP Status Codes CheatSheet [SAVE IT!] ๐Ÿ“œโœจ
Favicon
HTTP response status codes
Favicon
Emirates ID Status โ€” 4 Easy and Simple Steps to Check It
Favicon
Know Your Kuwait Civil ID Status Easily in 2023
Favicon
HTTP STATUS MESSAGES
Favicon
HTTP STATUS CODE
Favicon
12 Common HTTP Status Codes and Their Meanings
Favicon
Entendendo os cรณdigos de status HTTP: Um guia teรณrico para desenvolvedores
Favicon
418 Iโ€™m a Teapot
Favicon
HTTP Methods, Status Codes and their meaning
Favicon
Solving the conflict of using the HTTP status 409
Favicon
A Break Down of HTTP Status Code
Favicon
Status HTTP Fantรกsticos e Onde Habitam #2 - Os esquecidos
Favicon
The Complete Guide to Status Codes for Meaningful ReST APIs - The forgotten ones
Favicon
Status Codes: HTTP Status Codes
Favicon
View All HTTP Status Codes Offline ๐Ÿ˜œ
Favicon
Top 10 Commonly Used HTTP Status Codes
Favicon
http Status Code Cheat Sheet

Featured ones: