HTTP Request's Content Encoding field

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

HTTP Request's Content Encoding field

jmeter tea
I tried sending encoding in HTTP Request's Content Encoding
<http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Request>
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.


Is it a deprecated field or is there any specific usage/effect when
changing the encoding ?
Reply | Threaded
Open this post in threaded view
|

Re: HTTP Request's Content Encoding field

glinius@live.com
It is being used at least:

 1. For  setting request header
<https://github.com/apache/jmeter/blob/v5_0/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java#L315>  
 2. For  encoding POST request data
<https://github.com/apache/jmeter/blob/v5_0/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java#L320>  
 3. For  encoding query string
<https://github.com/apache/jmeter/blob/v5_0/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java#L1121>  

The easiest way of testing this is setting Content Encoding to something,
which cannot be resolved to a  Java Charset
<https://docs.oracle.com/javase/8/docs/api/index.html?java/nio/charset/StandardCharsets.html>
, in this case you will immediately get an  UnsupportedCharsetException
<https://docs.oracle.com/javase/8/docs/api/java/nio/charset/UnsupportedCharsetException.html>  

Another option of testing this is using  View Results Tree
<https://www.blazemeter.com/blog/how-debug-your-apache-jmeter-script>  
listener, if you leave the Content Encoding input blank - JMeter will send
default charset (UTF-8). If you set the encoding of your choice - JMeter
will add this as the  Content-Type header
<https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type>  
*charset* parameter

<http://www.jmeter-archive.org/file/t340375/Screenshot_2018-12-25_at_14.png>





--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HTTP Request's Content Encoding field

jmeter tea
Thank you for answering my question,
But still, what is the usage of setting a valid value, What is the benefit
over setting Content-Type header parameter?

On Tue, Dec 25, 2018 at 3:59 PM [hidden email] <[hidden email]> wrote:

> It is being used at least:
>
>  1. For  setting request header
> <
> https://github.com/apache/jmeter/blob/v5_0/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java#L315>
>
>  2. For  encoding POST request data
> <
> https://github.com/apache/jmeter/blob/v5_0/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java#L320>
>
>  3. For  encoding query string
> <
> https://github.com/apache/jmeter/blob/v5_0/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java#L1121>
>
>
> The easiest way of testing this is setting Content Encoding to something,
> which cannot be resolved to a  Java Charset
> <
> https://docs.oracle.com/javase/8/docs/api/index.html?java/nio/charset/StandardCharsets.html>
>
> , in this case you will immediately get an  UnsupportedCharsetException
> <
> https://docs.oracle.com/javase/8/docs/api/java/nio/charset/UnsupportedCharsetException.html>
>
>
> Another option of testing this is using  View Results Tree
> <https://www.blazemeter.com/blog/how-debug-your-apache-jmeter-script>
> listener, if you leave the Content Encoding input blank - JMeter will send
> default charset (UTF-8). If you set the encoding of your choice - JMeter
> will add this as the  Content-Type header
> <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type>
> *charset* parameter
>
> <
> http://www.jmeter-archive.org/file/t340375/Screenshot_2018-12-25_at_14.png>
>
>
>
>
>
>
> --
> Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

RE: HTTP Request's Content Encoding field

Shyam Panjiyar
Hi ,

Could you please help with Bean Shell Sampler Script for below requirement :-

Input - string sequence from JSON Extractor as 123.0/124.0/125.0

Out put - string sequence in variable as 123/124/125 respectively.

Thanks & Regards,
Shyam Kishor Panjiyar


-----Original Message-----
From: Jmeter Tea <[hidden email]>
Sent: 25 December 2018 20:22
To: JMeter Users List <[hidden email]>
Subject: Re: HTTP Request's Content Encoding field

Thank you for answering my question,
But still, what is the usage of setting a valid value, What is the benefit over setting Content-Type header parameter?

On Tue, Dec 25, 2018 at 3:59 PM [hidden email] <[hidden email]> wrote:

> It is being used at least:
>
>  1. For  setting request header
> https://github.com/apache/jmeter/blob/v5_0/src/protocol/http/org/apach
> e/jmeter/protocol/http/sampler/PostWriter.java#L315>
>  2. For  encoding POST request data
> <
> https://github.com/apache/jmeter/blob/v5_0/src/protocol/http/org/apach
> e/jmeter/protocol/http/sampler/PostWriter.java#L320>
>
>  3. For  encoding query string
> <
> https://github.com/apache/jmeter/blob/v5_0/src/protocol/http/org/apach
> e/jmeter/protocol/http/sampler/HTTPSamplerBase.java#L1121>
>
>
> The easiest way of testing this is setting Content Encoding to
> something, which cannot be resolved to a  Java Charset <
> https://docs.oracle.com/javase/8/docs/api/index.html?java/nio/charset/
> StandardCharsets.html>
>
> , in this case you will immediately get an  
> UnsupportedCharsetException <
> https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Unsupported
> CharsetException.html>
>
>
> Another option of testing this is using  View Results Tree
> <https://www.blazemeter.com/blog/how-debug-your-apache-jmeter-script>
> listener, if you leave the Content Encoding input blank - JMeter will
> send default charset (UTF-8). If you set the encoding of your choice -
> JMeter will add this as the  Content-Type header
> <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Typ
> e>
> *charset* parameter
>
> <
> http://www.jmeter-archive.org/file/t340375/Screenshot_2018-12-25_at_14
> .png>
>
>
>
>
>
>
> --
> Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HTTP Request's Content Encoding field

Felix Schumacher
Please don't hijack threads. That happens, when you reply to a mail and
change the subject, only.

Send your question by sending a fresh mail to the JMeters users list.

Thanks

 Felix

Am 09.05.19 um 14:51 schrieb Shyam Panjiyar:

> Hi ,
>
> Could you please help with Bean Shell Sampler Script for below requirement :-
>
> Input - string sequence from JSON Extractor as 123.0/124.0/125.0
>
> Out put - string sequence in variable as 123/124/125 respectively.
>
> Thanks & Regards,
> Shyam Kishor Panjiyar
>
>
> -----Original Message-----
> From: Jmeter Tea <[hidden email]>
> Sent: 25 December 2018 20:22
> To: JMeter Users List <[hidden email]>
> Subject: Re: HTTP Request's Content Encoding field
>
> Thank you for answering my question,
> But still, what is the usage of setting a valid value, What is the benefit over setting Content-Type header parameter?
>
> On Tue, Dec 25, 2018 at 3:59 PM [hidden email] <[hidden email]> wrote:
>
>> It is being used at least:
>>
>>  1. For  setting request header
>> https://github.com/apache/jmeter/blob/v5_0/src/protocol/http/org/apach
>> e/jmeter/protocol/http/sampler/PostWriter.java#L315>
>>  2. For  encoding POST request data
>> <
>> https://github.com/apache/jmeter/blob/v5_0/src/protocol/http/org/apach
>> e/jmeter/protocol/http/sampler/PostWriter.java#L320>
>>
>>  3. For  encoding query string
>> <
>> https://github.com/apache/jmeter/blob/v5_0/src/protocol/http/org/apach
>> e/jmeter/protocol/http/sampler/HTTPSamplerBase.java#L1121>
>>
>>
>> The easiest way of testing this is setting Content Encoding to
>> something, which cannot be resolved to a  Java Charset <
>> https://docs.oracle.com/javase/8/docs/api/index.html?java/nio/charset/
>> StandardCharsets.html>
>>
>> , in this case you will immediately get an  
>> UnsupportedCharsetException <
>> https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Unsupported
>> CharsetException.html>
>>
>>
>> Another option of testing this is using  View Results Tree
>> <https://www.blazemeter.com/blog/how-debug-your-apache-jmeter-script>
>> listener, if you leave the Content Encoding input blank - JMeter will
>> send default charset (UTF-8). If you set the encoding of your choice -
>> JMeter will add this as the  Content-Type header
>> <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Typ
>> e>
>> *charset* parameter
>>
>> <
>> http://www.jmeter-archive.org/file/t340375/Screenshot_2018-12-25_at_14
>> .png>
>>
>>
>>
>>
>>
>>
>> --
>> Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]