- Accept headers tells web service what kind of response client is accepting, so if a web service is capable of sending response in XML and JSON format and client sends Accept header as
application/xml
then XML response will be sent. For Accept header application/json
, server will send the JSON response.
- Content-Type header is used to tell server what is the format of data being sent in the request. If Content-Type header is
application/xml
then server will try to parse it as XML data. This header is useful in HTTP Post and Put requests.