How to send a HTTP response with the Transfer-Encoding HTTP header?
book
Article ID: KB0074029
calendar_today
Updated On:
Products
Versions
TIBCO ActiveMatrix BusinessWorks
5.x
Description
How can the "Send HTTP Response" activity be configured to return the Transfer-Encoding HTTP header?
Some HTTP services may need to attach a file in the HTTP response message. Typically, the Transfer-Encoding header is used with the "chunked" value because of the varying file sizes.
Manually adding the Transfer-Encoding header to the "Input Header" tab and setting its value to "chunked" will result in the raw message containing both Transfer-Encoding and Content-Length; which is contradictory. The majority of HTTP clients will tend to throw errors if such a response is received.
Issue/Introduction
How to send a HTTP response with the Transfer-Encoding HTTP header?
Environment
All supported versions
Resolution
We do not recommend manually adding the Transfer-Encoding header into the Input header tab, rather you can add this header by unchecking the 'Close Connection' option in the "Send HTTP Response" > Configuration tab. Unchecking this option will result in the Content-Length header being replaced with the Transfer-Encoding header.
Please note if "Flush Response" is also unchecked then it will force the "Send HTTP Response" activity to send Content-Length header.