JMeter - HTTP Request's Content Encoding field

2019-08-29 00:05发布

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)

0条回答
登录 后发表回答