HTTP defines eight methods (sometimes referred to as "verbs")
Can you help me find examples for each one so I can test and understand them better?
HTTP defines eight methods (sometimes referred to as "verbs")
Can you help me find examples for each one so I can test and understand them better?
First you should take a look into the HTTP 1.1 specification, especially the section method definitions.
OPTIONS Get information about how the server allows to communicate with.
Request:
Response:
GET Retrieve a resource.
Request:
Response:
HEAD Like GET, but returns just the HTTP header.
Request:
Response:
POST Create a new resource.
Request:
Response:
PUT Send data to the server.
DELETE Delete an existing resource.
TRACE Return the request headers sent by the client.
Request:
Response:
I don’t know exactly if these examples are correct. Feel free to correct them.
You can experiment with the different HTTP methods using the cURL command line tool. For example: