RESTful Web services Interview Questions and Answers

Connect with

What is the use of Accept and Content-Type Headers in HTTP Request?

Accept and Content-Type are important headers in Restful web services. 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 format of 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.

Connect with

1 thought on “RESTful Web services Interview Questions and Answers”

Leave a Comment

Your email address will not be published. Required fields are marked *