Using an HTTP Header Parameter to Specify the Content Type

It can be a useful to use a Content-Type HTTP header parameter especially where the REST service requires an XML request but returns a JSON response. When the JSON Format is selected, the REST data source adapter assumes that the format of the request and the format of the response will match. The REST data source automatically generates a header “Content-Type: application/json” in the request. This must be overridden with the value of "application/xml" so that the service can correctly interpret the request. 

To use an HTTP header parameter to submit an XML request and get a JSON response

Define your REST data source.
1. On the Basic tab, select the check box next to the JSON Format label.
2. On the Basics tab, scroll down to the Operations section.
3. Define the details for your operation, including the HTTP Verb, Operation Name, and Operation URL.
4. In the Header/Body Parameters table, add an OUT Param Name named response with a Data Type of XML. This is a Body parameter with the direction of OUT.
5. In the Header/Body Parameters table, add an IN Param Name named [rawdata] with a Data Type of XML. This is a Body parameter with the direction of IN.
6. Inn the Header/Body Parameters table, add an IN Param Name named Content-Type with a Data Type of string. This is a Header parameter with the direction of IN.
7. Clear all the XML <-> JSON check boxes for the [rawdata] parameter.
8. Select the XML <-> JSON check boxes for the response parameter.
9. Save your data source.
10. Invoke the service and provide a full request document for the [rawdata] input parameter, and providing the string application or XML for the Content-Type parameter.