4 Questions
What does the HTTP GET method usually do?
Retrieve data
Which HTTP request method is used to send data to create/update a resource?
POST
DELETE method deletes the specified resource.
True
What is the purpose of the OPTIONS HTTP request method?
describes the communication options for the target resource
Study Notes
HTTP Request Methods
- HTTP request methods indicate the desired action to be performed for a given resource, which can be retrieve, delete, update, or insert an item or multiple items.
- Each request method has a different semantic, and some of them share common features.
GET Method
- GET method is used to retrieve data (single item or multiple items).
- It displays the submitted input values in the URL, which can be cached or bookmarked.
- Submitted values can be:
- Query string (e.g., http://example.com/page/items?param1=value1¶m2=value1)
- Path Parameters (Segments) (e.g., http://example.com/page/items/value1/value2)
- Both (e.g., http://example.com/page/items/value/?param1=value1¶m2=value2)
- Usually used with tracking services.
POST Method
- POST method is used to send data to a server to create/update a resource or changing a resource’s state.
- Submitted data is stored in the request’s body.
- POST data cannot be cached or bookmarked.
- There are no restrictions on data length or type.
Other HTTP Request Methods
- PUT: used to send data to a server to create/update a resource.
- HEAD: almost identical to GET, but without the response body.
- DELETE: deletes the specified resource.
- PATCH: used to apply partial modifications to a resource.
- OPTIONS: describes the communication options for the target resource.
- CONNECT: used to start a two-way communications (a tunnel) with the requested resource.
- TRACE: used to perform a message loop-back test that tests the path for the target resource (useful for debugging purposes).
Resources
Learn about HTTP request methods, including GET, and how they are used to perform actions on resources. Understand the different semantics and features of each method.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free