Retrieving files from the server
GET Method
Preliminaries
This note provides supplementary information about the server's implementation of the standard HTTP GET method to retrieve a resource.
The GET method is the principal protocol for the vast majority of all HTTP requests. It is one of only two methods directly supported via HTML, the other being POST.
GET is the sine qua non of HTTP methods.
A browser generates a GET request when fulfilling HTML declarations similar to these:
<a href="page.html">
<img src="picture.jpg">
<link href="theme.css" type="text/css" rel="stylesheet" >
<script src="interactive.js" type="application/javascript">
When issuing a GET request, the user-agent specifies filtering, sorting, searching, and other limiting criteria in the query-string portion of a URL.
Request/response handlers
The server's request/response cycle for GET requests is handled by a sequence of modules to:
- Validate the user's permission to access the resource.
- Negotiate acceptance criteria with the user-agent.
- Verify that the resource is available.
- Dynamically compile certain types of resources.
- Compress the resource while in transit.
- Prepare the response headers for the return trip.
- Send the resource itself in the response body.
This is the sequential order of handlers that fulfill GET requests:
| Request Handler | Optional | Configurable | |
|---|---|---|---|
| 1 | Server Name Indication | no | no |
| 2 | Hosts | no | yes |
| 3 | IP Access | yes | yes |
| 4 | Resource Masks | yes | yes |
| 5 | Raw Path | no | no |
| 6 | Cookies | no | no |
| 7 | Forbidden | yes | yes |
| 8 | Cross Origin | yes | yes |
| 9 | RBAC | yes | yes |
| 10 | User Agent | yes | yes |
| 11 | Accept Types | no | yes |
| 12 | Accept Language | yes | yes |
| Dynamic Handler | Optional | Configurable | |
| 13 | Router | yes | yes |
| Response Handler | Optional | Configurable | |
| 14 | File Permissions | no | no |
| 15 | Content Types | no | yes |
| 16 | Etag | yes | no |
| 17 | If Modified Since | no | no |
| 18 | Last Modified | no | no |
| 19 | Cache Control | yes | yes |
| 20 | Range | yes | no |
| 21 | Content Encoding | yes | yes |
| 22 | Content Length | no | no |
| 23 | Status Codes | no | yes |
| 24 | Push Priority | yes | yes |
Success
Successful responses return status code 200 with the bytes of the resource in the response body.
Successful responses have these headers:
content-lengtheven if it is zero.content-typeif the server is properly configured for the filename's extension.last-modifiedwith the timestamp of the file's modification time.etagif the etag module is on, with the Etag hash identification for the file.content-encodingif the encoding module is on, with the compression algorithm applied to the response payload.content-languageif the accept-language module is on, with the language tag associated with the requested resource.cache-controlif the cache-control module is on, containing caching instructions for the browser.serverwith the value'rwserve'.datewith the time when the server began sending the response.
For reference purposes, refer to IETF RFC 7231 Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content section 4.3.1 for the basic protocol expected of HTTP GET requests.
