Messages
The formats of the request meassage and response messages contain Headers and body with some other information. Request messages consist of Request line, Headers, A blank line and Body. Response messages consist of Status line, Headers, A blank line and Body.
Request line has following format;
Request type | space | URL | space | HTTP version |
Status Line ha following format:
HTTP version | space | Status code | space | Status phrase |
Request type: methods like GET, POST etc.
URL: destination address to which request to be sent.
HTTP Version: version name of HTTP line 1.1.
Status code: code of three digits in the response message like 200, 404.(see table of status code from return from server )
Status phrase: shows more information of status code like 200 means OK, 404 means resources not found.
Headers : it is used to exchange more information between client and server like Date, Connection, MIME type, Accept etc.
There four types of headers
- General header :
header | Description |
Cache-control | Specifies information about caching |
Connection | Shows whether connection should be open or closed |
Date | Shows current date |
Upgrade | Specifies the preferred communication protocol. |
Mime-version | Shows the mime version used |
- Request header
Header | Description |
Accept | Media format client can accept |
Accept-charset | Shows whether connection should be open or closed |
Accept-encoding | Shows current date |
Accept-language | Specifies the preferred communication protocol. |
Form | The e-mail address of the user |
Host | Show the host and port number of the client |
If-modified-since | Send the document if newer than specified date |
If-match | Send the document if it matches given tag |
If-non-match | Send the document if it does not match given tag |
If-range | Send only the portion of the document that is missing |
If-unmodified-since | Send the document if not changed since specified date |
Referrer | Specifies the URL of the linked document |
User-agent | Identifies the client program |
- Response Header
header | Description |
Accept-range | Shows if server accepts the range requested by client |
Age | Shows the age of document |
Public | Shows the supported list of methods |
Retry-after | Specifies the date after which server is available. |
Server | Shows server name and version |
- Entity header: information about body of document. It used in response messages, requests like POST,PUT methods, that contains body.
header | Description |
Allow | List valid methods that can be used within URL |
Content-encoding | |
Content-type | Shows media type |
Content-language | |
Content-length | |
Content-range | |
Etag | Gives an entity tag |
Expires | Gives the date and time when contents may change |
Last-modified | Date and time of last change |
Location | Location of create and removal document. |
| |
Comments