1
ProgrammingSoftware

What are HTTP Verbs: Definition and usage

2 Mins read
  • HTTP is the acronym for Hypertext Transport Protocol, a standard protocol that allows information to be shared over computer networks.

HTTP is the acronym for Hypertext Transport Protocol, a standard protocol that allows information to be shared over computer networks.
Understanding the different HTTP verbs is crucial for getting the most out of your web browser, as well as being able to control the behavior of a website’s API. Below are the most common verbs used in HTTP requests along with their associated action:

For example, when you access your Gmail inbox and see the blue header with the “G” in it that says “GET” on top of your name, this means instructions are being sent for a GET request to be issued to your Gmail inbox. If you see an instruction like “POST” or “DELETE” in your browser’s window title bar, this means information is being sent for a POST or DELETE request respectively. Every HTTP request has one or two verbs associated with it.

What are the different HTTP Verbs?

GET: This request sends some data back to the client. The data can be a single resource, like a webpage, or an array of resources. The response from this request does not contain any metadata, just the result of the request itself (the data). All GET requests must always include both “accept” and “content-length”. For example, when you enter http://google.com into your web browser’s address bar and hit enter, Google is sending an HTTP GET request to server1.google.com in order to get the HTML source code for the homepage of Google (i.e., index html).

POST: This request adds new data to the resource identified by the “url” attribute. All POST requests must always include both “accept” and “content-length”.

PUT: This request has two possible forms depending on if it is acting as a client or server. If acting as a client, and if they have not specified a content-type to send the data in, then they will receive their entire body back as is. If acting as a server, and if they have specified a content-type for the request, then they will use that type instead of the one that was sent. This might include using multipart types or uploading an arbitrary file.

DELETE: This request deletes data from the resource identified by “url”. Usually GET can be used in its place to return no data. DELETE requests must always include both “accept” and “content-length”.

OPTIONS: This request describes how things are supposed to work on this resource. It is only sent when the browser makes a request. This request must always include both “accept” and “content-length”.

HEAD: This request is identical to GET, except that the server does not return any content to you. You might use this when doing HEAD requests to check if a resource exists without wasting bandwidth.

TRACE: This request logs all the data it passes back and forth for debugging purposes. It’s best not to use it unless you know what you’re doing, as most modern browsers don’t even support it anymore!

CONNECT: This request forces the connection to be made over https even if it was originally going to be http. Many browsers will automatically do this for you if the content-type is https.

OPTIONS: This request describes how things are supposed to work on this resource. It is only sent when the browser makes a request. This request must always include both “accept” and “content-length”.

Learn more about how HTTP works here.

To read more on microservices, see this article.

Don’t miss amazing tips!

1
Related posts
How ToProgrammingSoftwareTechnology

How to configure Apache Airflow on MacOS locally

4 Mins read
Table of contents0.1 Creating the project folder and the virtual environment0.2 Installing0.3 Running airflow0.4 Starting the webflow server0.5 Starting the scheduler0.6 Running…
Code ChallengesHow ToProgrammingSoftware

How To Implement Merge Sort and Quick Sort Algorithms In Python 3

3 Mins read
Table of contents0.1 Merge Sort0.2 Quick Sort0.3 Conclusion1 Don’t miss amazing tips! Let’s have a look at how to how to implement…
InterestingSoftwareTechnology

Getting started with TensorFlow, amazing basics

4 Mins read
Table of contents0.1 What is a Tensor?0.2 What is TensorFlow?0.3 How many models can I train with TensorFlow?0.4 How do I use…

Leave a Reply

Your email address will not be published. Required fields are marked *

20 − 12 =

×
ComputingHow To

Benefits Of Cloud Computing And Choosing The Right Provider