Blog / Introduction To HTTP Requests

Introduction To HTTP Requests

Chris Oliver

June 10, 2013

One of the first things to understand about web development is the four different HTTP requests. Today we are going to dive into them at a high level.

HTTP GET

The most common HTTP request is the GET method. This is simply retrieving a resource or page from a server. When you visit Google.com, you make GET request for their homepage. When you search, you're making a GET request for all search results that contain certain keywords.

HTTP POST

If you've ever posted a message on Facebook or Twitter, you've submitted a POST request. The POST method is used when you want to save something new on the service. When you register for an account, that's also going to be a POST request.

HTTP PUT/PATCH

The PUT and PATCH requests are used for modifying an existing record on the server. If you change your password on your Twitter account, it will use a PUT (or PATCH) request that tells Twitter to modify your account's password.

HTTP DELETE

The DELETE request is pretty self-explanatory; it deletes a record on the server. If you want to delete a tweet, you'll be submitting a DELETE request to Twitter to remove that tweet.

Conclusion

All in all, the 4 types of HTTP requests are very simple. You have access to viewing, creating, modifying, and deleting records on a service. Each of these requests have ways of submitting data so that you can do things like filter results.

In the next article, we will be talking how to combine HTTP requests with the URLs (or routes) your application responds to in order to create an application.

P.S. You might enjoy following me on Twitter.


Comments
Loading...

Want to stay up-to-date with Ruby on Rails?

Join 34,674+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.