40
What are the HTTP request methods, among which are GET
, POST
and DELETE
? What to use each of them, and what is the difference between them?
40
What are the HTTP request methods, among which are GET
, POST
and DELETE
? What to use each of them, and what is the difference between them?
48
5
Basically, if that’s what I understood, there are 8 types of methods of which:
GET, POST, DELETE, PUT, CONNECT, HEAD, TRACE, OPTIONS.
GET: Method that requests some resource or object from the server
HEAD: Requests information for a particular object without it being sent to the customer only to test the validity of the last access.
POST: Method used to send file/data or HTML form to the server.
OPTIONS: Through this method the client obtains the server properties.
DELETE: Informs through the URL the object to be deleted.
TRACE: To send a loopback message for testing.
PUT: Accepts to create or modify some server object.
CONNECT: Communicate with Proxy Servers.
Sources: http://www.vivaolinux.com.br/artigo/Um-pouco-do-protocolo-HTTP?pagina=4
1
GET
, POST
, PUT
, DELETE
are widely used in web projects API
and represent the operations CRUD
commonly used in databases.
Browser other questions tagged http http-methods
You are not signed in. Login or sign up in order to post.
Wow, HEAD was new to me. Most programmers don’t even care about these other methods, do they? Would it be valid to ask for examples of uses of these other methods, at least a description?
– user3628
The latter two are more obscure methods. The
trace
also not so much used (more to diagnose problems in the middle of the way).GET
andPOST
are trivial, and the rest are employed in Apis REST.– Anthony Accioly
About asking for examples, I think it is valid within a more specific context (like "when should I use
POST
vsPUT
?"), the community tends not to like wide questions very much (see the vote for this question to be closed).– Anthony Accioly
There are also method extensions, which you can use
-
and although they are not "official" it depends only on the server to have the interpretation of the method, for exampleMEU-METODO
do whatever I want on the server side.– Gabriel Gartz
An example of extension are the methods of Webdav.
– Anthony Accioly
It says on the wiki that it’s a protocol... it’s also an HTTP request method?
– user3628
It’s a protocol that extends HTTP with a few more methods that only make sense for the protocol itself (exposing a kind of file repository through HTTP).
– Anthony Accioly