-
Notifications
You must be signed in to change notification settings - Fork 0
HTTP Basics
Summary from article on : http://www.ntu.edu.sg/home/ehchua/programming/webprogramming/http_basics.html
- Key Request Types: GET,HEAD,PUT,POST,DELETE
- a) Client can request for the TCP connection to be Kept Alive, using "Connection:KeepAlive". In the HTTP Response Server would come back with the Max Timeout for which the TCP connection can persist and the max number of requests that can be served during this time. a) Client can request for the TCP connection to be closed after HTTP response is server by using "Connection:Close"
Conditional GET Requests ( Copied from http://www.ntu.edu.sg/home/ehchua/programming/webprogramming/http_basics.html)
In all the previous examples, the server returns the entire document if the request can be fulfilled (i.e. unconditional). You may use additional request header to issue a "conditional request". For example, to ask for the document based on the last-modified date (so as to decide whether to use the local cache copy), or to ask for a portion of the document (or range) instead of the entire document (useful for downloading large documents). The conditional request headers include:
- If-Modified-Since (check for response status code "304 Not Modified").
- If-Unmodified-Since
- If-Match
- If-None-Match
- If-Range
Cache Control: ( Copied from http://www.ntu.edu.sg/home/ehchua/programming/webprogramming/http_basics.html)
The client can send a request header "Cache-control: no-cache" to tell the proxy to get a fresh copy from the original server, even thought there is a local cached copy. Unfortunately, HTTP/1.0 server does not understand this header, but uses an older request header "Pragma: no-cache". You could include both headers in your request.