1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
87 views
by jon-t-7005 (8.2k points)
When using HTTP GET with a Web Service endpoint, the Content-Length header may be missing from the request. Why would that be, and how can I force it to be present?

1 Answer

0 votes

QIE will add the Content-Length HTTP header to the request when there is actual content in the HTTP request.  Typically, HTTP GET requests do not have any content, and it is considered best practice to omit the Content-Length header when no content is provided.

If the system you are connecting to requires the Content-Length header, you can add it manually.  On a Mapping or Destination node, click the "HTTP Headers" button, and add in http.header.Content-Length as a String with a value of 0.

 

When using a custom script, you would add this as a new parameter map item.  For example:

var parameterMap = qie.newParameterMap();
parameterMap.put("http.header.Content-Length", "0");
var urlTemplate = qie.evaluateTemplate(qie.getWsEndpointUrl("WS Name"));
var value = qie.callRESTWebService(
   "WS Name",
   urlTemplate,
   "GET",
   null,
   parameterMap,
   60000);
by jon-t-7005 (8.2k points)
...