From the course: Building and Securing RESTful APIs in ASP.NET Core

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

HTTP methods

HTTP methods - ASP.NET Core Tutorial

From the course: Building and Securing RESTful APIs in ASP.NET Core

Start my 1-month free trial

HTTP methods

- [Instructor] HTTP methods are the verbs that act on resources in a RESTful API. You're probably familiar with GET and POST. But what's the difference between POST and PUT? Let's take a look at what the HTTP spec has to say about these HTTP methods. First, we'll review the most common verbs that are used with RESTful endpoints. GET is the most common and simplest HTTP verb you can use. And it just retrieves the resource that you specify. HEAD is less common, but also simple. A HEAD request behaves exactly the same as the GET request, but it only returns the HTTP headers and doesn't return the resource itself. HEAD is useful when you need to look at headers like Expires to control caching of resources. Compared to methods like POST, which we'll look at next, GET and HEAD are both read-only. A GET or HEAD request should never directly change any application state. For example, a client shouldn't be able to update or delete a resource with a GET request. The HTTP spec calls methods that…

Contents