JMeter - HTTP Request's Content Encoding field has no effect

爱⌒轻易说出口 提交于 2019-12-13 03:14:34

问题


I tried sending encoding in HTTP Request's Content Encoding field but it doesn't seem to have any effect also in POST request

Content encoding to be used (for POST, PUT, PATCH and FILE). This is the character encoding to be used, and is not related to the Content-Encoding HTTP header.

I found an answer in archive stating to use HTTP Header Manager instead

HTTP Request sampler's Content Encoding field is related to Accept-Charset header. UTF-8, UTF-16, ISO-8859-1, etc. If you want to allow gzip you should use an HTTP Header Manager

Is it a deprecated field or is there any specific usage/effect when changing the encoding ?

Similar results with HTTPClient4 or Java implementation.

EDIT

I found an article about JMeter sending gzip in Content-Encoding header

Content-Encoding: gzip

But if I send gzip I get an error

java.nio.charset.UnsupportedCharsetException: gzip
at java.nio.charset.Charset.forName(Unknown Source)
at org.apache.http.entity.ContentType.create(ContentType.java:255)
at org.apache.http.client.entity.UrlEncodedFormEntity.<init>(UrlEncodedFormEntity.java:58)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sendPostData(HTTPHC4Impl.java:1442)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.handleMethod(HTTPHC4Impl.java:629)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:450)

来源:https://stackoverflow.com/questions/52179373/jmeter-http-requests-content-encoding-field-has-no-effect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!