繁体   English   中英

JMeter HTTP请求中的传输编码标头已存在错误

[英]Transfer-encoding header already present error in JMeter HTTP Request

我在jmeter的“响应数据”选项卡中不断收到以下错误:

org.apache.http.client.ClientProtocolException
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:909)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:481)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:298)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1105)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1094)
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.http.ProtocolException: Transfer-encoding header already present
    at org.apache.http.protocol.RequestContent.process(RequestContent.java:93)
    at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:109)
    at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:176)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:518)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
    ... 9 more

我的测试脚本是通过JMeter代理创建的。 该测试通过POST将多部分数据(jpg图像)发送到REST API资源。 由JMeter中的Recording Controller自动创建的HTTP Header Manager具有以下内容:

Transfer-Encoding : chunked
Accept : application/json
Accept-Encoding : gzip, deflate

知道响应为何出现错误吗?

请求:

POST http://localhost:8080/email/v2/client/user/name/loadtest1@test.net/

POST data:
--oYtJU-XXTgMSkyaIrRBYNXw8AfMA2nMQSzJ20bJr--


Cookie Data:
JSESSIONID=b3bb843e-dafd-4cc5-8b0b-045c490736f8

Request Headers:
Connection: keep-alive
Transfer-Encoding: chunked
Accept: application/json
Accept-Encoding: gzip, deflate

尝试从HTTP标头管理器中删除Transfer-Encoding标头。

可以在您的问题中显示Http Request吗? 和标题管理器在其中吗?

  1. http请求失败的以下参数的状态是什么:

    • 使用multipart / form-data进行HTTP POST
    • 浏览器兼容的标题
  2. 您的测试计划中没有其他HTTP Header Manager实例,对吗? 好像是,它可能会造成干扰,因为HTTP标头管理器的范围不仅限于不作为子级添加的采样器。

  3. 您的发帖请求详细信息看起来与文件上传请求不同。 查看使用Apache JMeter进行的上载和下载方案指南,以了解是否错过了重要事项。

  4. 切勿在同一台计算机上运行Load Generator和被测应用程序。 即使在开发或调试测试时。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM