有人知道如何发送'Transfer-Encoding‘设置为“块”的帖子请求吗?我是否只是在我的请求中设置了标题?
如果是这样的话,宗会自动对请求分块吗?块大小可配置吗?
还有什么方法可以禁用“内容长度”标题吗?我的应用程序只期望一种内容长度或传输编码,而不是两者兼而有之。
编辑:
对不起,我应该提供一些示例代码的。下面是我使用的Tsung片段:
<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>如上所示,我在请求中设置了“传输-编码”标题。我有两个要求。
发布于 2019-12-04 08:19:05
您只需重写标题,请参阅Doc的Changelog:
12.2.2.变化 TSUN-307 -允许所有HTTP报头被
阅读Doc,6.2.2HTTP
新的1.2.2:您现在可以添加任何HTTP报头,如下所示:
<request> <http url="/bla" method="POST" contents="bla=blu&name=glop"> <www_authenticate userid="Aladdin" passwd="open sesame"/> <http_header name="Cache-Control" value="no-cache"/> <http_header name="Referer" value="http://www.w3.org/"/> </http> </request> https://stackoverflow.com/questions/59171423
复制相似问题