GET
The GET method is used to download a representation of a resource. It is the most commonly used HTTP method. Servers may select between several representations, for example, different media types, languages, or make a variation customized for the currently authenticated user. The resource may itself be a representation of another resource, for example, the resource http://example.com/index
might be a listing of files, and http://example.com/index.html
might always refer to the HTML document representing that listing of files.
Writing requests (clients)
Clients should use use GET to download a specified document. GET is going to be the standard method used to perform downloads. If the response payload is not necessary, but the client is only reading headers, or testing for the existence of the resource, see the HEAD method.
Reading requests (servers)
If the resource does not exist, return a 404 Not Found response.
If the resource is negotiated, determine which representation to return.
If conditional headers are present, test them and return 304 Not Modified as necessary.
Request Payloads
Payloads on a GET request have no defined semantics; while servers can use the request payload for any purpose, intermediate nodes may also manipulate or drop the request payload. For sending documents to a server, that cannot be encoded into the request-URI due to length, see the REPORT method.
Overview table
- Name
- GET
- Description
- Returns a representation of the resource
- Safeness
- Safe, Idempotent
- Conditional fail
- 304 Not Modified
- Specification
- RFC 5789: Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content. 4.3.1. GET