Receiving chunked transfer encoded content from a HTTP client

Date:19 April 2012
Product/Release:LANSA Integrator - All versions
Abstract:Receiving chunked transfer encoded content
Submitted By:LANSA Technical Support

If you have a HTTP client sending you 'chunked transfer' encoded content, the following information details how to receive it on an IBM i server using Apache server.

You can configure a Proxy instance to 'dechunk' the content and send it to another Apache instance as content and Content-Length property.

The directive to use is:

SetEnv proxy-sendcl 1

Refer to http://httpd.apache.org/docs/current/mod/mod_proxy.html for detailed explanation and examples.

Sample configuration on the Proxy (Web Application) server:

#
# Apache Configuration
#
LoadModule proxy_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
LoadModule proxy_http_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
#
Listen nn.nn.nn.nn:nnnn
#
ProxyReverse On
ProxyRequests Off
#
ProxyTimeout 3000
<Proxy *>
Order Allow,Deny
Allow from all
</Proxy>
#
SetEnv proxy-sendcl 1
ProxyPass /cgi-bin/jsmdirect http://myserver:nnnn/cgi-bin/jsmdirect

====================================================================