Does anybody know how to send POST requests with 'Transfer-Encoding' set to 'chunked' in Tsung? Do I just set the header in my request?
If so, will Tsung automatically chunk the requests? Is the chunk size configurable?
Also is there some method to disable the "Content-Length" header? My application expects only one of Content-Length or Transfer-Encoding, not both.
EDIT:
Sorry, I should have provided some sample code. Here is the Tsung snippet I used:
<request subst="true">
<http url="/blah/blah" method="POST" contents="{ "source_ip": "%%_requestip%%", "source_port": "%%_requestport%%", "method": "%%_method%%", "url":"%%_myurl%%", "http_version":"1.1","user_info":[{"username":"%%_myusername%%","client_id": "%%_myclientid%%"}],"headers":[{"host": "%%_apiid%%"},{"Authorization":"Bearer %%_mytoken%%"},{"x-api-key":"%%_myapikey%%"},%%_myheaderid%%]}">
<http_header name="Head123" value="approxyhttpjkjdalsjdjasldjasldjlasjldjasdkjasljdlasjd"/>
<http_header name="Transfer-Encoding" value="chunked"/>
<http_header name="X-CorrelationID" value="Id-%%_requestid%%" />
<http_header name="Content-Type" value="application/text"/>
</http>
</request>
As shown above, I am setting a 'Transfer-Encoding' header in my request. I have two requirements.
- How do I tell Tsung to send chunked packets? Is it by setting the 'Transfer-Encoding: chunked' header?
- How do I tell Tsung to NOT send a 'Content-Length' header in a POST request? My application cannot handle both Transfer-Encoding and Content-Length, it needs one or the other.
You can just override the header, see Doc's Changelog:
Read the Doc's, 6.2.2 HTTP: