Ruby HTTP request response - 2
HTTP request headers can be broadly divided into 3 parts -
- Response Headers
- Request Headers
Sample HTTP request format
"GET /blog HTTP/1.1"
Let’s divide it into sections and see what each one means
All http requests use Greenwich Standard Time(GMT) or UTC. Here is common format -
‘Date: Fri, 23 Aug 2019 10:17:27 GMT’
reference - RFC
It is a 3 digit code that represents response from server. Like
Status Code: 304
Tell the date when cookie will expire.
Tells date and time when origin of content was last modified.
Tells the web server used to process this http request.
Used to indicate various flags in cache control mechanism. Like
- max-age - to indicate client accepts cached data whose age is not greater than value in seconds).
- public - server can use any cache to store data
- no-cache - cache must not use data for subsequent request without re-validation.
- no-store - server can not use cache the request or response.
- must-revalidate - revalidate stale data before using