To obtain better performance when working with streamed data, HTTP Connector sends requests and responses with the Transfer-Encoding: chunked encoding when the size of the data being sent is unknown. However, some HTTP clients and servers are not prepared to receive such data and fail.
Report such failures to the server or client owner to correct. Meanwhile, work around the issue by manually modifying the Listener and Request operations to output Content-Length encoded bodies.
The following example shows the HTTP Listener operation configured with responseStreamingMode NEVER, which indicates to use Content-Length encoding:
<flow name="main-contact-read">
<http:listener path="account/{accountId}/main-contact" allowedMethods="GET" responseStreamingMode="NEVER" config-ref="HTTP_Listener_config"/>
<!-- fetch main contact for accountId -->
</flow>
The following example shows an HTTP Requester operation configured with requestStreamingMode NEVER to use Content-Length encoding:
<flow name="connectingToFaultyServer">
<http:request method="GET" url="http://somehost.com:8081/api/v3/someresource" requestStreamingMode="NEVER"/>
<logger level="INFO"
message="#['Received a ' ++ attributes.status code ++ ' response with body: {' ++ payload ++ '}']"/>
</flow>