1.2k questions
1.4k answers
361 comments
339 users
The REST web service call will only include the content-type if there is content by default. This is because the content-type header is a description of the payload or content of the web service call, if there is no content, then technically there should not be content-type. However, there are some systems that still require the content-type header even if there is no content being sent. To include the content-type header (and any other header desired), you can place the values in the parameterMap passed into the call.
var parameterMap = qie.newParameterMap(); parameterMap.put("http.header.content-type", 'application/xml'); parameterMap.put("http.header.headerName", 'someValue'); var urlTemplate = qie.evaluateTemplate(qie.getWsEndpointUrl('wsName')); var response = qie.callRESTWebService( 'MyConnection', // Web Service Connection Name 'https://somesite.com/getData', // URL to call 'GET', // Operation null, // Content is null 'application/xml', // Because content is null, this parameter is ignored parameterMap, // contains the header's that will be forced onto the call 60000); // Call timeout
See also:
Handling HTTP requests and responses
Making Requests via qie.callRESTWebService()