Could any one please help me to get difference between sending data as Request Body and Request Header?
Please give me clear d开发者_如何学JAVAefinition with a sample code, or suggest the specified books for that.
Thank You,
Bhanu Prakash Achary
I believe you are referring to the difference between GET and POST method of HTTP.
This link may be helpful: Methods GET and POST in HTML forms
Assuming you're talking about HTTP Request Headers
HTTP Request Headers are pretty much defined (i.e. RFC 2616 has set of header field you can use for HTTP Request Headers) headers. If you add your own, other applications that read HTTP request headers won't understand it, if it follows RFC 2616 strictly.
As for Request Body, also known as Message Body
The message-body (if any) of an HTTP message is used to carry the entity-body associated with the request or response. The message-body differs from the entity-body only when a transfer-coding has been applied, as indicated by the Transfer-Encoding header field (section 14.41).
Basically, every request/response can carry a message body. That message can be a text, parameters, image, etc. It can contain an entity body combined with a message body (which is encoded).
More info, visit RFC 2616.
精彩评论