HTTP methods used to designate the appropriate action to direct a server towards a resource. GET and POST are the most widely known; PATCH and DELETE also fit in that category, among others.
Questions tagged [http-method]
355 questions
1212
votes
16 answers
Use of PUT vs PATCH methods in REST API real life scenarios
First of all, some definitions:
PUT is defined in Section 9.6 RFC 2616:
The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers to an already existing resource, the enclosed entity SHOULD…

Dmitry Kudryavtsev
- 16,354
- 4
- 25
- 32
443
votes
7 answers
What is the difference between POST and GET?
I've only recently been getting involved with PHP/AJAX/jQuery and it seems to me that an important part of these technologies is that of POST and GET.
First, what is the difference between POST and GET? Through experimenting, I know that GET appends…

Hristo
- 45,559
- 65
- 163
- 230
342
votes
6 answers
Should I use PATCH or PUT in my REST API?
I want to design my rest endpoint with the appropriate method for the following scenario.
There is a group. Each group has a status. The group can be activated or inactivated by the admin.
Should I design my end point as
PUT…

java_geek
- 17,585
- 30
- 91
- 113
282
votes
15 answers
When should I use GET or POST method? What's the difference between them?
What's the difference when using GET or POST method? Which one is more secure? What are (dis)advantages of each of them?
(similar question)

Adriana
- 8,464
- 13
- 36
- 37
227
votes
9 answers
Which HTTP methods match up to which CRUD methods?
In RESTful style programming, we should use HTTP methods as our building blocks. I'm a little confused though which methods match up to the classic CRUD methods. GET/Read and DELETE/Delete are obvious enough.
However, what is the difference between…

Drew
- 15,158
- 17
- 68
- 77
177
votes
3 answers
curl -GET and -X GET
Curl offers a series of different http method calls that are prefixed with a X, but also offers the same methods without. I've tried both and I can't seem to figure out the difference. Can someone explain to me quickly how these two operations…

matsko
- 21,895
- 21
- 102
- 144
129
votes
6 answers
What method should I use for a login (authentication) request?
I would like to know which http method I should use when doing a login request, and why? Since this request creates an object (a user session) on the server, I think it should be POST, what do you think? But since the login request should be…

greg0ire
- 22,714
- 16
- 72
- 101
119
votes
5 answers
RESTful Alternatives to DELETE Request Body
While the HTTP 1.1 spec seems to allow message bodies on DELETE requests, it seems to indicate that servers should ignore it since there are no defined semantics for it.
4.3 Message Body
A server SHOULD read and forward a message-body on any…

shelley
- 7,206
- 4
- 36
- 63
71
votes
3 answers
Payloads of HTTP Request Methods
The Wikipedia entry on HTTP lists the following HTTP request methods:
HEAD: Asks for the response identical to the one that would correspond to a GET request, but without the response body.
GET: Requests a representation of the specified…

Alix Axel
- 151,645
- 95
- 393
- 500
53
votes
3 answers
What is difference between HTTP methods GET, POST, PUT and DELETE
I am developing REST WCF service and As theoretically i know when to opt for what purpose.
GET to get the resource
PUT to update
POST to Insert
DELETE to delete
But what is the disadvantage if we don't follow this above rule, suppose to insert a…

Fooker
- 786
- 2
- 10
- 19
46
votes
8 answers
Rails Responds with 404 on CORS Preflight Options Request
I'm creating a set of services using Rails 4, which I am consuming with a JavaScript browser application. Cross-origin GETS are working fine, but my POSTs are failing the preflight OPTIONS check with a 404 error. At least, I think that's what's…

Rolandus
- 758
- 2
- 6
- 12
45
votes
2 answers
What is the HTTP method PURGE?
Today when using Postman I noticed the method option of PURGE. I have never encountered it in practice and cannot find the explanation of it's purpose.
What is this method used for, where did it come from, and is there a spec for it somewhere?

Sam Berry
- 7,394
- 6
- 40
- 58
35
votes
3 answers
How to detect HTTP method in CodeIgniter
How can I detect HTTP method in CodeIgniter controller class?
Edited:
Is there any other way than using $_SERVER['REQUEST_METHOD'] in CodeIgniter?

Sgn.
- 1,696
- 2
- 14
- 27
34
votes
1 answer
Any method to get constant for HTTP GET, POST, PUT, DELETE?
For example, HttpServletResponse has the HTTP status codes as constants like
public static final int SC_OK = 200;
public static final int SC_CREATED = 201;
public static final int SC_BAD_REQUEST = 400;
public static final int SC_UNAUTHORIZED =…

daydreamer
- 87,243
- 191
- 450
- 722
23
votes
6 answers
How to get the HTTP method in AWS Lambda?
In an AWS Lambda code, how can I get the HTTP method (e.g. GET, POST...) of an HTTP request coming from the AWS Gateway API?
I understand from the documentation that context.httpMethod is the solution for that.
However, I cannot manage to make it…

Xavier M
- 547
- 3
- 6
- 13