You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Philippe Mouawad <ph...@gmail.com> on 2017/05/20 14:31:16 UTC

Re: MultipartEntityBuilder and Charset US-ASCII

Hello,
Any thoughts on that ?

Thx

On Wednesday, April 19, 2017, Philippe Mouawad <ph...@gmail.com>
wrote:

> Hello,
> Anybody has an idea about that ?
> Thanks
>
> On Mon, Apr 17, 2017 at 10:50 PM, Philippe Mouawad <
> philippe.mouawad@gmail.com
> <javascript:_e(%7B%7D,'cvml','philippe.mouawad@gmail.com');>> wrote:
>
>> Hello,
>> At JMeter we have a bug report (https://bz.apache.org/bugzill
>> a/show_bug.cgi?id=60800) related to Multipart Form POST request
>>
>> A user reports that he has an issue with a request created by JMeter due
>> to the presence in Request Headers of "charset=US-ASCII" at end of boundary
>> in Content-Type.
>>
>> ------------------------------------------------------------------------
>> POST http://localhost:8081/
>>
>> POST data:
>> --5v5So93EEOXPO8DIg4kmR-vfmsbimn
>> Content-Disposition: form-data; name="toto"
>>
>> titi
>> --5v5So93EEOXPO8DIg4kmR-vfmsbimn--
>>
>>
>> *Request Headers:*
>> Connection: keep-alive
>> Content-Length: 123
>> *Content-Type: multipart/form-data;
>> boundary=5v5So93EEOXPO8DIg4kmR-vfmsbimn; charset=US-ASCII*
>> Host: localhost:8081
>> User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
>>
>> ------------------------------------------------------------------------
>>
>> The code is created through (https://github.com/apache/jme
>> ter/blob/trunk/src/protocol/http/org/apache/jmeter/
>> protocol/http/sampler/HTTPHC4Impl.java#L1201):
>>
>> 1/            MultipartEntityBuilder multipartEntityBuilder =
>> MultipartEntityBuilder.create();
>>
>> 2/ As not Content Type is set in GUI, we default to US-ASCII so call:
>> multipartEntityBuilder.setCharset("US-ASCII");
>>
>> 3/
>> multipartEntityBuilder.setLaxMode();
>>
>> 4/ For every parameter:
>>                 StringBody stringBody = new StringBody(arg.getValue(),
>> ContentType.create("text/plain", charset));
>>                 FormBodyPart formPart = FormBodyPartBuilder.create(
>>                         parameterName, stringBody).build();
>>                 multipartEntityBuilder.addPart(formPart);
>>
>> 5/
>>             HttpEntity entity = multipartEntityBuilder.build();
>>             post.setEntity(entity);
>>
>>
>> So my questions are the following:
>> 1/ Is it correct to add this charset part ?
>> 2/ Could you point me to the reference part of RFC that mentions this ?
>> 3/ Is it correct to avoid setting charset in this case in API which would
>> lead to such request instead ?
>>
>>
>>
>> POST http://localhost:8081/
>>
>> POST data:
>> --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr
>> Content-Disposition: form-data; name="toto"
>>
>> titi
>> --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr--
>>
>> Request Headers:
>> Connection: keep-alive
>> Content-Length: 135
>> Content-Type: multipart/form-data; boundary=xjNHd_UhEEpqC2ZoFCpGR
>> zYzHK90ljsdpfTr
>> Host: localhost:8081
>> User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
>>
>>
>> Thanks for your help
>> Regards
>> Philippe M.
>>
>
>
>
> --
> Cordialement.
> Philippe Mouawad.
>
>
>

-- 
Cordialement.
Philippe Mouawad.

Re: MultipartEntityBuilder and Charset US-ASCII

Posted by Gary Gregory <ga...@gmail.com>.
On Sat, Jun 3, 2017 at 1:51 AM, Philippe Mouawad <philippe.mouawad@gmail.com
> wrote:

> Hello,
> Any answers on those questions ?
>

Can you follow up with more detail perhaps on Oleg's reference to
https://www.ietf.org/rfc/rfc1341.txt ?

IOW, do you agree that the RFC allows for the HTTP message you posted?

Gary


> Thank you
>
> On Sun, May 28, 2017 at 12:47 PM, Philippe Mouawad <
> philippe.mouawad@gmail.com> wrote:
>
> > Hi Oleg,
> > From the 3 questions I asked, to which one are you answering ?
> > The first ?
> > If possible, can you point the paragraph ?
> >
> > Thanks
> >
> >
> > On Sunday, May 28, 2017, Oleg Kalnichevski <ol...@apache.org> wrote:
> >
> >> On Sat, 2017-05-20 at 16:31 +0200, Philippe Mouawad wrote:
> >> > Hello,
> >> > Any thoughts on that ?
> >> >
> >>
> >> Hi Philippe
> >>
> >> This is perfectly legal. See
> >>
> >> https://www.ietf.org/rfc/rfc1341.txt
> >>
> >> Oleg
> >>
> >>
> >>
> >> > Thx
> >> >
> >> > On Wednesday, April 19, 2017, Philippe Mouawad <philippe.mouawad@gmai
> >> > l.com>
> >> > wrote:
> >> >
> >> > > Hello,
> >> > > Anybody has an idea about that ?
> >> > > Thanks
> >> > >
> >> > > On Mon, Apr 17, 2017 at 10:50 PM, Philippe Mouawad <
> >> > > philippe.mouawad@gmail.com
> >> > > <javascript:_e(%7B%7D,'cvml','philippe.mouawad@gmail.com');>>
> >> > > wrote:
> >> > >
> >> > > > Hello,
> >> > > > At JMeter we have a bug report (https://bz.apache.org/bugzill
> >> > > > a/show_bug.cgi?id=60800) related to Multipart Form POST request
> >> > > >
> >> > > > A user reports that he has an issue with a request created by
> >> > > > JMeter due
> >> > > > to the presence in Request Headers of "charset=US-ASCII" at end
> >> > > > of boundary
> >> > > > in Content-Type.
> >> > > >
> >> > > > ---------------------------------------------------------------
> >> > > > ---------
> >> > > > POST http://localhost:8081/
> >> > > >
> >> > > > POST data:
> >> > > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn
> >> > > > Content-Disposition: form-data; name="toto"
> >> > > >
> >> > > > titi
> >> > > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn--
> >> > > >
> >> > > >
> >> > > > *Request Headers:*
> >> > > > Connection: keep-alive
> >> > > > Content-Length: 123
> >> > > > *Content-Type: multipart/form-data;
> >> > > > boundary=5v5So93EEOXPO8DIg4kmR-vfmsbimn; charset=US-ASCII*
> >> > > > Host: localhost:8081
> >> > > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
> >> > > >
> >> > > > ---------------------------------------------------------------
> >> > > > ---------
> >> > > >
> >> > > > The code is created through (https://github.com/apache/jme
> >> > > > ter/blob/trunk/src/protocol/http/org/apache/jmeter/
> >> > > > protocol/http/sampler/HTTPHC4Impl.java#L1201):
> >> > > >
> >> > > > 1/            MultipartEntityBuilder multipartEntityBuilder =
> >> > > > MultipartEntityBuilder.create();
> >> > > >
> >> > > > 2/ As not Content Type is set in GUI, we default to US-ASCII so
> >> > > > call:
> >> > > > multipartEntityBuilder.setCharset("US-ASCII");
> >> > > >
> >> > > > 3/
> >> > > > multipartEntityBuilder.setLaxMode();
> >> > > >
> >> > > > 4/ For every parameter:
> >> > > >                 StringBody stringBody = new
> >> > > > StringBody(arg.getValue(),
> >> > > > ContentType.create("text/plain", charset));
> >> > > >                 FormBodyPart formPart =
> >> > > > FormBodyPartBuilder.create(
> >> > > >                         parameterName, stringBody).build();
> >> > > >                 multipartEntityBuilder.addPart(formPart);
> >> > > >
> >> > > > 5/
> >> > > >             HttpEntity entity = multipartEntityBuilder.build();
> >> > > >             post.setEntity(entity);
> >> > > >
> >> > > >
> >> > > > So my questions are the following:
> >> > > > 1/ Is it correct to add this charset part ?
> >> > > > 2/ Could you point me to the reference part of RFC that mentions
> >> > > > this ?
> >> > > > 3/ Is it correct to avoid setting charset in this case in API
> >> > > > which would
> >> > > > lead to such request instead ?
> >> > > >
> >> > > >
> >> > > >
> >> > > > POST http://localhost:8081/
> >> > > >
> >> > > > POST data:
> >> > > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr
> >> > > > Content-Disposition: form-data; name="toto"
> >> > > >
> >> > > > titi
> >> > > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr--
> >> > > >
> >> > > > Request Headers:
> >> > > > Connection: keep-alive
> >> > > > Content-Length: 135
> >> > > > Content-Type: multipart/form-data; boundary=xjNHd_UhEEpqC2ZoFCpGR
> >> > > > zYzHK90ljsdpfTr
> >> > > > Host: localhost:8081
> >> > > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
> >> > > >
> >> > > >
> >> > > > Thanks for your help
> >> > > > Regards
> >> > > > Philippe M.
> >> > > >
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > Cordialement.
> >> > > Philippe Mouawad.
> >> > >
> >> > >
> >> > >
> >> >
> >> >
> >>
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
> >
> >
> >
> >
>
>
> --
> Cordialement.
> Philippe Mouawad.
>

Re: MultipartEntityBuilder and Charset US-ASCII

Posted by Gary Gregory <ga...@gmail.com>.
On Sat, Jun 3, 2017 at 1:51 AM, Philippe Mouawad <philippe.mouawad@gmail.com
> wrote:

> Hello,
> Any answers on those questions ?
>

Can you follow up with more detail perhaps on Oleg's reference to
https://www.ietf.org/rfc/rfc1341.txt ?

IOW, do you agree that the RFC allows for the HTTP message you posted?

Gary


> Thank you
>
> On Sun, May 28, 2017 at 12:47 PM, Philippe Mouawad <
> philippe.mouawad@gmail.com> wrote:
>
> > Hi Oleg,
> > From the 3 questions I asked, to which one are you answering ?
> > The first ?
> > If possible, can you point the paragraph ?
> >
> > Thanks
> >
> >
> > On Sunday, May 28, 2017, Oleg Kalnichevski <ol...@apache.org> wrote:
> >
> >> On Sat, 2017-05-20 at 16:31 +0200, Philippe Mouawad wrote:
> >> > Hello,
> >> > Any thoughts on that ?
> >> >
> >>
> >> Hi Philippe
> >>
> >> This is perfectly legal. See
> >>
> >> https://www.ietf.org/rfc/rfc1341.txt
> >>
> >> Oleg
> >>
> >>
> >>
> >> > Thx
> >> >
> >> > On Wednesday, April 19, 2017, Philippe Mouawad <philippe.mouawad@gmai
> >> > l.com>
> >> > wrote:
> >> >
> >> > > Hello,
> >> > > Anybody has an idea about that ?
> >> > > Thanks
> >> > >
> >> > > On Mon, Apr 17, 2017 at 10:50 PM, Philippe Mouawad <
> >> > > philippe.mouawad@gmail.com
> >> > > <javascript:_e(%7B%7D,'cvml','philippe.mouawad@gmail.com');>>
> >> > > wrote:
> >> > >
> >> > > > Hello,
> >> > > > At JMeter we have a bug report (https://bz.apache.org/bugzill
> >> > > > a/show_bug.cgi?id=60800) related to Multipart Form POST request
> >> > > >
> >> > > > A user reports that he has an issue with a request created by
> >> > > > JMeter due
> >> > > > to the presence in Request Headers of "charset=US-ASCII" at end
> >> > > > of boundary
> >> > > > in Content-Type.
> >> > > >
> >> > > > ---------------------------------------------------------------
> >> > > > ---------
> >> > > > POST http://localhost:8081/
> >> > > >
> >> > > > POST data:
> >> > > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn
> >> > > > Content-Disposition: form-data; name="toto"
> >> > > >
> >> > > > titi
> >> > > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn--
> >> > > >
> >> > > >
> >> > > > *Request Headers:*
> >> > > > Connection: keep-alive
> >> > > > Content-Length: 123
> >> > > > *Content-Type: multipart/form-data;
> >> > > > boundary=5v5So93EEOXPO8DIg4kmR-vfmsbimn; charset=US-ASCII*
> >> > > > Host: localhost:8081
> >> > > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
> >> > > >
> >> > > > ---------------------------------------------------------------
> >> > > > ---------
> >> > > >
> >> > > > The code is created through (https://github.com/apache/jme
> >> > > > ter/blob/trunk/src/protocol/http/org/apache/jmeter/
> >> > > > protocol/http/sampler/HTTPHC4Impl.java#L1201):
> >> > > >
> >> > > > 1/            MultipartEntityBuilder multipartEntityBuilder =
> >> > > > MultipartEntityBuilder.create();
> >> > > >
> >> > > > 2/ As not Content Type is set in GUI, we default to US-ASCII so
> >> > > > call:
> >> > > > multipartEntityBuilder.setCharset("US-ASCII");
> >> > > >
> >> > > > 3/
> >> > > > multipartEntityBuilder.setLaxMode();
> >> > > >
> >> > > > 4/ For every parameter:
> >> > > >                 StringBody stringBody = new
> >> > > > StringBody(arg.getValue(),
> >> > > > ContentType.create("text/plain", charset));
> >> > > >                 FormBodyPart formPart =
> >> > > > FormBodyPartBuilder.create(
> >> > > >                         parameterName, stringBody).build();
> >> > > >                 multipartEntityBuilder.addPart(formPart);
> >> > > >
> >> > > > 5/
> >> > > >             HttpEntity entity = multipartEntityBuilder.build();
> >> > > >             post.setEntity(entity);
> >> > > >
> >> > > >
> >> > > > So my questions are the following:
> >> > > > 1/ Is it correct to add this charset part ?
> >> > > > 2/ Could you point me to the reference part of RFC that mentions
> >> > > > this ?
> >> > > > 3/ Is it correct to avoid setting charset in this case in API
> >> > > > which would
> >> > > > lead to such request instead ?
> >> > > >
> >> > > >
> >> > > >
> >> > > > POST http://localhost:8081/
> >> > > >
> >> > > > POST data:
> >> > > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr
> >> > > > Content-Disposition: form-data; name="toto"
> >> > > >
> >> > > > titi
> >> > > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr--
> >> > > >
> >> > > > Request Headers:
> >> > > > Connection: keep-alive
> >> > > > Content-Length: 135
> >> > > > Content-Type: multipart/form-data; boundary=xjNHd_UhEEpqC2ZoFCpGR
> >> > > > zYzHK90ljsdpfTr
> >> > > > Host: localhost:8081
> >> > > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
> >> > > >
> >> > > >
> >> > > > Thanks for your help
> >> > > > Regards
> >> > > > Philippe M.
> >> > > >
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > Cordialement.
> >> > > Philippe Mouawad.
> >> > >
> >> > >
> >> > >
> >> >
> >> >
> >>
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
> >
> >
> >
> >
>
>
> --
> Cordialement.
> Philippe Mouawad.
>

Re: MultipartEntityBuilder and Charset US-ASCII

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello,
Any answers on those questions ?

Thank you

On Sun, May 28, 2017 at 12:47 PM, Philippe Mouawad <
philippe.mouawad@gmail.com> wrote:

> Hi Oleg,
> From the 3 questions I asked, to which one are you answering ?
> The first ?
> If possible, can you point the paragraph ?
>
> Thanks
>
>
> On Sunday, May 28, 2017, Oleg Kalnichevski <ol...@apache.org> wrote:
>
>> On Sat, 2017-05-20 at 16:31 +0200, Philippe Mouawad wrote:
>> > Hello,
>> > Any thoughts on that ?
>> >
>>
>> Hi Philippe
>>
>> This is perfectly legal. See
>>
>> https://www.ietf.org/rfc/rfc1341.txt
>>
>> Oleg
>>
>>
>>
>> > Thx
>> >
>> > On Wednesday, April 19, 2017, Philippe Mouawad <philippe.mouawad@gmai
>> > l.com>
>> > wrote:
>> >
>> > > Hello,
>> > > Anybody has an idea about that ?
>> > > Thanks
>> > >
>> > > On Mon, Apr 17, 2017 at 10:50 PM, Philippe Mouawad <
>> > > philippe.mouawad@gmail.com
>> > > <javascript:_e(%7B%7D,'cvml','philippe.mouawad@gmail.com');>>
>> > > wrote:
>> > >
>> > > > Hello,
>> > > > At JMeter we have a bug report (https://bz.apache.org/bugzill
>> > > > a/show_bug.cgi?id=60800) related to Multipart Form POST request
>> > > >
>> > > > A user reports that he has an issue with a request created by
>> > > > JMeter due
>> > > > to the presence in Request Headers of "charset=US-ASCII" at end
>> > > > of boundary
>> > > > in Content-Type.
>> > > >
>> > > > ---------------------------------------------------------------
>> > > > ---------
>> > > > POST http://localhost:8081/
>> > > >
>> > > > POST data:
>> > > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn
>> > > > Content-Disposition: form-data; name="toto"
>> > > >
>> > > > titi
>> > > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn--
>> > > >
>> > > >
>> > > > *Request Headers:*
>> > > > Connection: keep-alive
>> > > > Content-Length: 123
>> > > > *Content-Type: multipart/form-data;
>> > > > boundary=5v5So93EEOXPO8DIg4kmR-vfmsbimn; charset=US-ASCII*
>> > > > Host: localhost:8081
>> > > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
>> > > >
>> > > > ---------------------------------------------------------------
>> > > > ---------
>> > > >
>> > > > The code is created through (https://github.com/apache/jme
>> > > > ter/blob/trunk/src/protocol/http/org/apache/jmeter/
>> > > > protocol/http/sampler/HTTPHC4Impl.java#L1201):
>> > > >
>> > > > 1/            MultipartEntityBuilder multipartEntityBuilder =
>> > > > MultipartEntityBuilder.create();
>> > > >
>> > > > 2/ As not Content Type is set in GUI, we default to US-ASCII so
>> > > > call:
>> > > > multipartEntityBuilder.setCharset("US-ASCII");
>> > > >
>> > > > 3/
>> > > > multipartEntityBuilder.setLaxMode();
>> > > >
>> > > > 4/ For every parameter:
>> > > >                 StringBody stringBody = new
>> > > > StringBody(arg.getValue(),
>> > > > ContentType.create("text/plain", charset));
>> > > >                 FormBodyPart formPart =
>> > > > FormBodyPartBuilder.create(
>> > > >                         parameterName, stringBody).build();
>> > > >                 multipartEntityBuilder.addPart(formPart);
>> > > >
>> > > > 5/
>> > > >             HttpEntity entity = multipartEntityBuilder.build();
>> > > >             post.setEntity(entity);
>> > > >
>> > > >
>> > > > So my questions are the following:
>> > > > 1/ Is it correct to add this charset part ?
>> > > > 2/ Could you point me to the reference part of RFC that mentions
>> > > > this ?
>> > > > 3/ Is it correct to avoid setting charset in this case in API
>> > > > which would
>> > > > lead to such request instead ?
>> > > >
>> > > >
>> > > >
>> > > > POST http://localhost:8081/
>> > > >
>> > > > POST data:
>> > > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr
>> > > > Content-Disposition: form-data; name="toto"
>> > > >
>> > > > titi
>> > > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr--
>> > > >
>> > > > Request Headers:
>> > > > Connection: keep-alive
>> > > > Content-Length: 135
>> > > > Content-Type: multipart/form-data; boundary=xjNHd_UhEEpqC2ZoFCpGR
>> > > > zYzHK90ljsdpfTr
>> > > > Host: localhost:8081
>> > > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
>> > > >
>> > > >
>> > > > Thanks for your help
>> > > > Regards
>> > > > Philippe M.
>> > > >
>> > >
>> > >
>> > >
>> > > --
>> > > Cordialement.
>> > > Philippe Mouawad.
>> > >
>> > >
>> > >
>> >
>> >
>>
>
>
> --
> Cordialement.
> Philippe Mouawad.
>
>
>
>


-- 
Cordialement.
Philippe Mouawad.

Re: MultipartEntityBuilder and Charset US-ASCII

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello,
Any answers on those questions ?

Thank you

On Sun, May 28, 2017 at 12:47 PM, Philippe Mouawad <
philippe.mouawad@gmail.com> wrote:

> Hi Oleg,
> From the 3 questions I asked, to which one are you answering ?
> The first ?
> If possible, can you point the paragraph ?
>
> Thanks
>
>
> On Sunday, May 28, 2017, Oleg Kalnichevski <ol...@apache.org> wrote:
>
>> On Sat, 2017-05-20 at 16:31 +0200, Philippe Mouawad wrote:
>> > Hello,
>> > Any thoughts on that ?
>> >
>>
>> Hi Philippe
>>
>> This is perfectly legal. See
>>
>> https://www.ietf.org/rfc/rfc1341.txt
>>
>> Oleg
>>
>>
>>
>> > Thx
>> >
>> > On Wednesday, April 19, 2017, Philippe Mouawad <philippe.mouawad@gmai
>> > l.com>
>> > wrote:
>> >
>> > > Hello,
>> > > Anybody has an idea about that ?
>> > > Thanks
>> > >
>> > > On Mon, Apr 17, 2017 at 10:50 PM, Philippe Mouawad <
>> > > philippe.mouawad@gmail.com
>> > > <javascript:_e(%7B%7D,'cvml','philippe.mouawad@gmail.com');>>
>> > > wrote:
>> > >
>> > > > Hello,
>> > > > At JMeter we have a bug report (https://bz.apache.org/bugzill
>> > > > a/show_bug.cgi?id=60800) related to Multipart Form POST request
>> > > >
>> > > > A user reports that he has an issue with a request created by
>> > > > JMeter due
>> > > > to the presence in Request Headers of "charset=US-ASCII" at end
>> > > > of boundary
>> > > > in Content-Type.
>> > > >
>> > > > ---------------------------------------------------------------
>> > > > ---------
>> > > > POST http://localhost:8081/
>> > > >
>> > > > POST data:
>> > > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn
>> > > > Content-Disposition: form-data; name="toto"
>> > > >
>> > > > titi
>> > > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn--
>> > > >
>> > > >
>> > > > *Request Headers:*
>> > > > Connection: keep-alive
>> > > > Content-Length: 123
>> > > > *Content-Type: multipart/form-data;
>> > > > boundary=5v5So93EEOXPO8DIg4kmR-vfmsbimn; charset=US-ASCII*
>> > > > Host: localhost:8081
>> > > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
>> > > >
>> > > > ---------------------------------------------------------------
>> > > > ---------
>> > > >
>> > > > The code is created through (https://github.com/apache/jme
>> > > > ter/blob/trunk/src/protocol/http/org/apache/jmeter/
>> > > > protocol/http/sampler/HTTPHC4Impl.java#L1201):
>> > > >
>> > > > 1/            MultipartEntityBuilder multipartEntityBuilder =
>> > > > MultipartEntityBuilder.create();
>> > > >
>> > > > 2/ As not Content Type is set in GUI, we default to US-ASCII so
>> > > > call:
>> > > > multipartEntityBuilder.setCharset("US-ASCII");
>> > > >
>> > > > 3/
>> > > > multipartEntityBuilder.setLaxMode();
>> > > >
>> > > > 4/ For every parameter:
>> > > >                 StringBody stringBody = new
>> > > > StringBody(arg.getValue(),
>> > > > ContentType.create("text/plain", charset));
>> > > >                 FormBodyPart formPart =
>> > > > FormBodyPartBuilder.create(
>> > > >                         parameterName, stringBody).build();
>> > > >                 multipartEntityBuilder.addPart(formPart);
>> > > >
>> > > > 5/
>> > > >             HttpEntity entity = multipartEntityBuilder.build();
>> > > >             post.setEntity(entity);
>> > > >
>> > > >
>> > > > So my questions are the following:
>> > > > 1/ Is it correct to add this charset part ?
>> > > > 2/ Could you point me to the reference part of RFC that mentions
>> > > > this ?
>> > > > 3/ Is it correct to avoid setting charset in this case in API
>> > > > which would
>> > > > lead to such request instead ?
>> > > >
>> > > >
>> > > >
>> > > > POST http://localhost:8081/
>> > > >
>> > > > POST data:
>> > > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr
>> > > > Content-Disposition: form-data; name="toto"
>> > > >
>> > > > titi
>> > > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr--
>> > > >
>> > > > Request Headers:
>> > > > Connection: keep-alive
>> > > > Content-Length: 135
>> > > > Content-Type: multipart/form-data; boundary=xjNHd_UhEEpqC2ZoFCpGR
>> > > > zYzHK90ljsdpfTr
>> > > > Host: localhost:8081
>> > > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
>> > > >
>> > > >
>> > > > Thanks for your help
>> > > > Regards
>> > > > Philippe M.
>> > > >
>> > >
>> > >
>> > >
>> > > --
>> > > Cordialement.
>> > > Philippe Mouawad.
>> > >
>> > >
>> > >
>> >
>> >
>>
>
>
> --
> Cordialement.
> Philippe Mouawad.
>
>
>
>


-- 
Cordialement.
Philippe Mouawad.

Re: MultipartEntityBuilder and Charset US-ASCII

Posted by Philippe Mouawad <ph...@gmail.com>.
Hi Oleg,
From the 3 questions I asked, to which one are you answering ?
The first ?
If possible, can you point the paragraph ?

Thanks

On Sunday, May 28, 2017, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Sat, 2017-05-20 at 16:31 +0200, Philippe Mouawad wrote:
> > Hello,
> > Any thoughts on that ?
> >
>
> Hi Philippe
>
> This is perfectly legal. See
>
> https://www.ietf.org/rfc/rfc1341.txt
>
> Oleg
>
>
>
> > Thx
> >
> > On Wednesday, April 19, 2017, Philippe Mouawad <philippe.mouawad@gmai
> > l.com>
> > wrote:
> >
> > > Hello,
> > > Anybody has an idea about that ?
> > > Thanks
> > >
> > > On Mon, Apr 17, 2017 at 10:50 PM, Philippe Mouawad <
> > > philippe.mouawad@gmail.com <javascript:;>
> > > <javascript:_e(%7B%7D,'cvml','philippe.mouawad@gmail.com
> <javascript:;>');>>
> > > wrote:
> > >
> > > > Hello,
> > > > At JMeter we have a bug report (https://bz.apache.org/bugzill
> > > > a/show_bug.cgi?id=60800) related to Multipart Form POST request
> > > >
> > > > A user reports that he has an issue with a request created by
> > > > JMeter due
> > > > to the presence in Request Headers of "charset=US-ASCII" at end
> > > > of boundary
> > > > in Content-Type.
> > > >
> > > > ---------------------------------------------------------------
> > > > ---------
> > > > POST http://localhost:8081/
> > > >
> > > > POST data:
> > > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn
> > > > Content-Disposition: form-data; name="toto"
> > > >
> > > > titi
> > > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn--
> > > >
> > > >
> > > > *Request Headers:*
> > > > Connection: keep-alive
> > > > Content-Length: 123
> > > > *Content-Type: multipart/form-data;
> > > > boundary=5v5So93EEOXPO8DIg4kmR-vfmsbimn; charset=US-ASCII*
> > > > Host: localhost:8081
> > > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
> > > >
> > > > ---------------------------------------------------------------
> > > > ---------
> > > >
> > > > The code is created through (https://github.com/apache/jme
> > > > ter/blob/trunk/src/protocol/http/org/apache/jmeter/
> > > > protocol/http/sampler/HTTPHC4Impl.java#L1201):
> > > >
> > > > 1/            MultipartEntityBuilder multipartEntityBuilder =
> > > > MultipartEntityBuilder.create();
> > > >
> > > > 2/ As not Content Type is set in GUI, we default to US-ASCII so
> > > > call:
> > > > multipartEntityBuilder.setCharset("US-ASCII");
> > > >
> > > > 3/
> > > > multipartEntityBuilder.setLaxMode();
> > > >
> > > > 4/ For every parameter:
> > > >                 StringBody stringBody = new
> > > > StringBody(arg.getValue(),
> > > > ContentType.create("text/plain", charset));
> > > >                 FormBodyPart formPart =
> > > > FormBodyPartBuilder.create(
> > > >                         parameterName, stringBody).build();
> > > >                 multipartEntityBuilder.addPart(formPart);
> > > >
> > > > 5/
> > > >             HttpEntity entity = multipartEntityBuilder.build();
> > > >             post.setEntity(entity);
> > > >
> > > >
> > > > So my questions are the following:
> > > > 1/ Is it correct to add this charset part ?
> > > > 2/ Could you point me to the reference part of RFC that mentions
> > > > this ?
> > > > 3/ Is it correct to avoid setting charset in this case in API
> > > > which would
> > > > lead to such request instead ?
> > > >
> > > >
> > > >
> > > > POST http://localhost:8081/
> > > >
> > > > POST data:
> > > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr
> > > > Content-Disposition: form-data; name="toto"
> > > >
> > > > titi
> > > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr--
> > > >
> > > > Request Headers:
> > > > Connection: keep-alive
> > > > Content-Length: 135
> > > > Content-Type: multipart/form-data; boundary=xjNHd_UhEEpqC2ZoFCpGR
> > > > zYzHK90ljsdpfTr
> > > > Host: localhost:8081
> > > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
> > > >
> > > >
> > > > Thanks for your help
> > > > Regards
> > > > Philippe M.
> > > >
> > >
> > >
> > >
> > > --
> > > Cordialement.
> > > Philippe Mouawad.
> > >
> > >
> > >
> >
> >
>


-- 
Cordialement.
Philippe Mouawad.

Re: MultipartEntityBuilder and Charset US-ASCII

Posted by Philippe Mouawad <ph...@gmail.com>.
Hi Oleg,
From the 3 questions I asked, to which one are you answering ?
The first ?
If possible, can you point the paragraph ?

Thanks

On Sunday, May 28, 2017, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Sat, 2017-05-20 at 16:31 +0200, Philippe Mouawad wrote:
> > Hello,
> > Any thoughts on that ?
> >
>
> Hi Philippe
>
> This is perfectly legal. See
>
> https://www.ietf.org/rfc/rfc1341.txt
>
> Oleg
>
>
>
> > Thx
> >
> > On Wednesday, April 19, 2017, Philippe Mouawad <philippe.mouawad@gmai
> > l.com>
> > wrote:
> >
> > > Hello,
> > > Anybody has an idea about that ?
> > > Thanks
> > >
> > > On Mon, Apr 17, 2017 at 10:50 PM, Philippe Mouawad <
> > > philippe.mouawad@gmail.com <javascript:;>
> > > <javascript:_e(%7B%7D,'cvml','philippe.mouawad@gmail.com
> <javascript:;>');>>
> > > wrote:
> > >
> > > > Hello,
> > > > At JMeter we have a bug report (https://bz.apache.org/bugzill
> > > > a/show_bug.cgi?id=60800) related to Multipart Form POST request
> > > >
> > > > A user reports that he has an issue with a request created by
> > > > JMeter due
> > > > to the presence in Request Headers of "charset=US-ASCII" at end
> > > > of boundary
> > > > in Content-Type.
> > > >
> > > > ---------------------------------------------------------------
> > > > ---------
> > > > POST http://localhost:8081/
> > > >
> > > > POST data:
> > > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn
> > > > Content-Disposition: form-data; name="toto"
> > > >
> > > > titi
> > > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn--
> > > >
> > > >
> > > > *Request Headers:*
> > > > Connection: keep-alive
> > > > Content-Length: 123
> > > > *Content-Type: multipart/form-data;
> > > > boundary=5v5So93EEOXPO8DIg4kmR-vfmsbimn; charset=US-ASCII*
> > > > Host: localhost:8081
> > > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
> > > >
> > > > ---------------------------------------------------------------
> > > > ---------
> > > >
> > > > The code is created through (https://github.com/apache/jme
> > > > ter/blob/trunk/src/protocol/http/org/apache/jmeter/
> > > > protocol/http/sampler/HTTPHC4Impl.java#L1201):
> > > >
> > > > 1/            MultipartEntityBuilder multipartEntityBuilder =
> > > > MultipartEntityBuilder.create();
> > > >
> > > > 2/ As not Content Type is set in GUI, we default to US-ASCII so
> > > > call:
> > > > multipartEntityBuilder.setCharset("US-ASCII");
> > > >
> > > > 3/
> > > > multipartEntityBuilder.setLaxMode();
> > > >
> > > > 4/ For every parameter:
> > > >                 StringBody stringBody = new
> > > > StringBody(arg.getValue(),
> > > > ContentType.create("text/plain", charset));
> > > >                 FormBodyPart formPart =
> > > > FormBodyPartBuilder.create(
> > > >                         parameterName, stringBody).build();
> > > >                 multipartEntityBuilder.addPart(formPart);
> > > >
> > > > 5/
> > > >             HttpEntity entity = multipartEntityBuilder.build();
> > > >             post.setEntity(entity);
> > > >
> > > >
> > > > So my questions are the following:
> > > > 1/ Is it correct to add this charset part ?
> > > > 2/ Could you point me to the reference part of RFC that mentions
> > > > this ?
> > > > 3/ Is it correct to avoid setting charset in this case in API
> > > > which would
> > > > lead to such request instead ?
> > > >
> > > >
> > > >
> > > > POST http://localhost:8081/
> > > >
> > > > POST data:
> > > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr
> > > > Content-Disposition: form-data; name="toto"
> > > >
> > > > titi
> > > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr--
> > > >
> > > > Request Headers:
> > > > Connection: keep-alive
> > > > Content-Length: 135
> > > > Content-Type: multipart/form-data; boundary=xjNHd_UhEEpqC2ZoFCpGR
> > > > zYzHK90ljsdpfTr
> > > > Host: localhost:8081
> > > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
> > > >
> > > >
> > > > Thanks for your help
> > > > Regards
> > > > Philippe M.
> > > >
> > >
> > >
> > >
> > > --
> > > Cordialement.
> > > Philippe Mouawad.
> > >
> > >
> > >
> >
> >
>


-- 
Cordialement.
Philippe Mouawad.

Re: MultipartEntityBuilder and Charset US-ASCII

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sat, 2017-05-20 at 16:31 +0200, Philippe Mouawad wrote:
> Hello,
> Any thoughts on that ?
> 

Hi Philippe

This is perfectly legal. See

https://www.ietf.org/rfc/rfc1341.txt

Oleg



> Thx
> 
> On Wednesday, April 19, 2017, Philippe Mouawad <philippe.mouawad@gmai
> l.com>
> wrote:
> 
> > Hello,
> > Anybody has an idea about that ?
> > Thanks
> > 
> > On Mon, Apr 17, 2017 at 10:50 PM, Philippe Mouawad <
> > philippe.mouawad@gmail.com
> > <javascript:_e(%7B%7D,'cvml','philippe.mouawad@gmail.com');>>
> > wrote:
> > 
> > > Hello,
> > > At JMeter we have a bug report (https://bz.apache.org/bugzill
> > > a/show_bug.cgi?id=60800) related to Multipart Form POST request
> > > 
> > > A user reports that he has an issue with a request created by
> > > JMeter due
> > > to the presence in Request Headers of "charset=US-ASCII" at end
> > > of boundary
> > > in Content-Type.
> > > 
> > > ---------------------------------------------------------------
> > > ---------
> > > POST http://localhost:8081/
> > > 
> > > POST data:
> > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn
> > > Content-Disposition: form-data; name="toto"
> > > 
> > > titi
> > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn--
> > > 
> > > 
> > > *Request Headers:*
> > > Connection: keep-alive
> > > Content-Length: 123
> > > *Content-Type: multipart/form-data;
> > > boundary=5v5So93EEOXPO8DIg4kmR-vfmsbimn; charset=US-ASCII*
> > > Host: localhost:8081
> > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
> > > 
> > > ---------------------------------------------------------------
> > > ---------
> > > 
> > > The code is created through (https://github.com/apache/jme
> > > ter/blob/trunk/src/protocol/http/org/apache/jmeter/
> > > protocol/http/sampler/HTTPHC4Impl.java#L1201):
> > > 
> > > 1/            MultipartEntityBuilder multipartEntityBuilder =
> > > MultipartEntityBuilder.create();
> > > 
> > > 2/ As not Content Type is set in GUI, we default to US-ASCII so
> > > call:
> > > multipartEntityBuilder.setCharset("US-ASCII");
> > > 
> > > 3/
> > > multipartEntityBuilder.setLaxMode();
> > > 
> > > 4/ For every parameter:
> > >                 StringBody stringBody = new
> > > StringBody(arg.getValue(),
> > > ContentType.create("text/plain", charset));
> > >                 FormBodyPart formPart =
> > > FormBodyPartBuilder.create(
> > >                         parameterName, stringBody).build();
> > >                 multipartEntityBuilder.addPart(formPart);
> > > 
> > > 5/
> > >             HttpEntity entity = multipartEntityBuilder.build();
> > >             post.setEntity(entity);
> > > 
> > > 
> > > So my questions are the following:
> > > 1/ Is it correct to add this charset part ?
> > > 2/ Could you point me to the reference part of RFC that mentions
> > > this ?
> > > 3/ Is it correct to avoid setting charset in this case in API
> > > which would
> > > lead to such request instead ?
> > > 
> > > 
> > > 
> > > POST http://localhost:8081/
> > > 
> > > POST data:
> > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr
> > > Content-Disposition: form-data; name="toto"
> > > 
> > > titi
> > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr--
> > > 
> > > Request Headers:
> > > Connection: keep-alive
> > > Content-Length: 135
> > > Content-Type: multipart/form-data; boundary=xjNHd_UhEEpqC2ZoFCpGR
> > > zYzHK90ljsdpfTr
> > > Host: localhost:8081
> > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
> > > 
> > > 
> > > Thanks for your help
> > > Regards
> > > Philippe M.
> > > 
> > 
> > 
> > 
> > --
> > Cordialement.
> > Philippe Mouawad.
> > 
> > 
> > 
> 
> 

Re: MultipartEntityBuilder and Charset US-ASCII

Posted by Philippe Mouawad <p....@ubik-ingenierie.com>.
Hello Gary,
No unfortunately.
I was hoping to get some lights from the mailing list here.


Regards

On Mon, May 22, 2017 at 6:46 AM, Gary Gregory <ga...@gmail.com>
wrote:

> Philippe,
>
> Have you solved this?
>
> Gary
>
>
> On May 20, 2017 7:31 AM, "Philippe Mouawad" <ph...@gmail.com>
> wrote:
>
> Hello,
> Any thoughts on that ?
>
> Thx
>
> On Wednesday, April 19, 2017, Philippe Mouawad <philippe.mouawad@gmail.com
> >
> wrote:
>
> > Hello,
> > Anybody has an idea about that ?
> > Thanks
> >
> > On Mon, Apr 17, 2017 at 10:50 PM, Philippe Mouawad <
> > philippe.mouawad@gmail.com
> > <javascript:_e(%7B%7D,'cvml','philippe.mouawad@gmail.com');>> wrote:
> >
> >> Hello,
> >> At JMeter we have a bug report (https://bz.apache.org/bugzill
> >> a/show_bug.cgi?id=60800) related to Multipart Form POST request
> >>
> >> A user reports that he has an issue with a request created by JMeter due
> >> to the presence in Request Headers of "charset=US-ASCII" at end of
> boundary
> >> in Content-Type.
> >>
> >> ------------------------------------------------------------
> ------------
> >> POST http://localhost:8081/
> >>
> >> POST data:
> >> --5v5So93EEOXPO8DIg4kmR-vfmsbimn
> >> Content-Disposition: form-data; name="toto"
> >>
> >> titi
> >> --5v5So93EEOXPO8DIg4kmR-vfmsbimn--
> >>
> >>
> >> *Request Headers:*
> >> Connection: keep-alive
> >> Content-Length: 123
> >> *Content-Type: multipart/form-data;
> >> boundary=5v5So93EEOXPO8DIg4kmR-vfmsbimn; charset=US-ASCII*
> >> Host: localhost:8081
> >> User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
> >>
> >> ------------------------------------------------------------
> ------------
> >>
> >> The code is created through (https://github.com/apache/jme
> >> ter/blob/trunk/src/protocol/http/org/apache/jmeter/
> >> protocol/http/sampler/HTTPHC4Impl.java#L1201):
> >>
> >> 1/            MultipartEntityBuilder multipartEntityBuilder =
> >> MultipartEntityBuilder.create();
> >>
> >> 2/ As not Content Type is set in GUI, we default to US-ASCII so call:
> >> multipartEntityBuilder.setCharset("US-ASCII");
> >>
> >> 3/
> >> multipartEntityBuilder.setLaxMode();
> >>
> >> 4/ For every parameter:
> >>                 StringBody stringBody = new StringBody(arg.getValue(),
> >> ContentType.create("text/plain", charset));
> >>                 FormBodyPart formPart = FormBodyPartBuilder.create(
> >>                         parameterName, stringBody).build();
> >>                 multipartEntityBuilder.addPart(formPart);
> >>
> >> 5/
> >>             HttpEntity entity = multipartEntityBuilder.build();
> >>             post.setEntity(entity);
> >>
> >>
> >> So my questions are the following:
> >> 1/ Is it correct to add this charset part ?
> >> 2/ Could you point me to the reference part of RFC that mentions this ?
> >> 3/ Is it correct to avoid setting charset in this case in API which
> would
> >> lead to such request instead ?
> >>
> >>
> >>
> >> POST http://localhost:8081/
> >>
> >> POST data:
> >> --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr
> >> Content-Disposition: form-data; name="toto"
> >>
> >> titi
> >> --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr--
> >>
> >> Request Headers:
> >> Connection: keep-alive
> >> Content-Length: 135
> >> Content-Type: multipart/form-data; boundary=xjNHd_UhEEpqC2ZoFCpGR
> >> zYzHK90ljsdpfTr
> >> Host: localhost:8081
> >> User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
> >>
> >>
> >> Thanks for your help
> >> Regards
> >> Philippe M.
> >>
> >
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
> >
> >
> >
>
> --
> Cordialement.
> Philippe Mouawad.
>



-- 
Cordialement.
Philippe Mouawad.
Ubik-Ingénierie

UBIK LOAD PACK Web Site <http://www.ubikloadpack.com/>

UBIK LOAD PACK on TWITTER <https://twitter.com/ubikloadpack>

Re: MultipartEntityBuilder and Charset US-ASCII

Posted by Gary Gregory <ga...@gmail.com>.
Philippe,

Have you solved this?

Gary


On May 20, 2017 7:31 AM, "Philippe Mouawad" <ph...@gmail.com>
wrote:

Hello,
Any thoughts on that ?

Thx

On Wednesday, April 19, 2017, Philippe Mouawad <ph...@gmail.com>
wrote:

> Hello,
> Anybody has an idea about that ?
> Thanks
>
> On Mon, Apr 17, 2017 at 10:50 PM, Philippe Mouawad <
> philippe.mouawad@gmail.com
> <javascript:_e(%7B%7D,'cvml','philippe.mouawad@gmail.com');>> wrote:
>
>> Hello,
>> At JMeter we have a bug report (https://bz.apache.org/bugzill
>> a/show_bug.cgi?id=60800) related to Multipart Form POST request
>>
>> A user reports that he has an issue with a request created by JMeter due
>> to the presence in Request Headers of "charset=US-ASCII" at end of
boundary
>> in Content-Type.
>>
>> ------------------------------------------------------------------------
>> POST http://localhost:8081/
>>
>> POST data:
>> --5v5So93EEOXPO8DIg4kmR-vfmsbimn
>> Content-Disposition: form-data; name="toto"
>>
>> titi
>> --5v5So93EEOXPO8DIg4kmR-vfmsbimn--
>>
>>
>> *Request Headers:*
>> Connection: keep-alive
>> Content-Length: 123
>> *Content-Type: multipart/form-data;
>> boundary=5v5So93EEOXPO8DIg4kmR-vfmsbimn; charset=US-ASCII*
>> Host: localhost:8081
>> User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
>>
>> ------------------------------------------------------------------------
>>
>> The code is created through (https://github.com/apache/jme
>> ter/blob/trunk/src/protocol/http/org/apache/jmeter/
>> protocol/http/sampler/HTTPHC4Impl.java#L1201):
>>
>> 1/            MultipartEntityBuilder multipartEntityBuilder =
>> MultipartEntityBuilder.create();
>>
>> 2/ As not Content Type is set in GUI, we default to US-ASCII so call:
>> multipartEntityBuilder.setCharset("US-ASCII");
>>
>> 3/
>> multipartEntityBuilder.setLaxMode();
>>
>> 4/ For every parameter:
>>                 StringBody stringBody = new StringBody(arg.getValue(),
>> ContentType.create("text/plain", charset));
>>                 FormBodyPart formPart = FormBodyPartBuilder.create(
>>                         parameterName, stringBody).build();
>>                 multipartEntityBuilder.addPart(formPart);
>>
>> 5/
>>             HttpEntity entity = multipartEntityBuilder.build();
>>             post.setEntity(entity);
>>
>>
>> So my questions are the following:
>> 1/ Is it correct to add this charset part ?
>> 2/ Could you point me to the reference part of RFC that mentions this ?
>> 3/ Is it correct to avoid setting charset in this case in API which would
>> lead to such request instead ?
>>
>>
>>
>> POST http://localhost:8081/
>>
>> POST data:
>> --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr
>> Content-Disposition: form-data; name="toto"
>>
>> titi
>> --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr--
>>
>> Request Headers:
>> Connection: keep-alive
>> Content-Length: 135
>> Content-Type: multipart/form-data; boundary=xjNHd_UhEEpqC2ZoFCpGR
>> zYzHK90ljsdpfTr
>> Host: localhost:8081
>> User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
>>
>>
>> Thanks for your help
>> Regards
>> Philippe M.
>>
>
>
>
> --
> Cordialement.
> Philippe Mouawad.
>
>
>

--
Cordialement.
Philippe Mouawad.

Re: MultipartEntityBuilder and Charset US-ASCII

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sat, 2017-05-20 at 16:31 +0200, Philippe Mouawad wrote:
> Hello,
> Any thoughts on that ?
> 

Hi Philippe

This is perfectly legal. See

https://www.ietf.org/rfc/rfc1341.txt

Oleg



> Thx
> 
> On Wednesday, April 19, 2017, Philippe Mouawad <philippe.mouawad@gmai
> l.com>
> wrote:
> 
> > Hello,
> > Anybody has an idea about that ?
> > Thanks
> > 
> > On Mon, Apr 17, 2017 at 10:50 PM, Philippe Mouawad <
> > philippe.mouawad@gmail.com
> > <javascript:_e(%7B%7D,'cvml','philippe.mouawad@gmail.com');>>
> > wrote:
> > 
> > > Hello,
> > > At JMeter we have a bug report (https://bz.apache.org/bugzill
> > > a/show_bug.cgi?id=60800) related to Multipart Form POST request
> > > 
> > > A user reports that he has an issue with a request created by
> > > JMeter due
> > > to the presence in Request Headers of "charset=US-ASCII" at end
> > > of boundary
> > > in Content-Type.
> > > 
> > > ---------------------------------------------------------------
> > > ---------
> > > POST http://localhost:8081/
> > > 
> > > POST data:
> > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn
> > > Content-Disposition: form-data; name="toto"
> > > 
> > > titi
> > > --5v5So93EEOXPO8DIg4kmR-vfmsbimn--
> > > 
> > > 
> > > *Request Headers:*
> > > Connection: keep-alive
> > > Content-Length: 123
> > > *Content-Type: multipart/form-data;
> > > boundary=5v5So93EEOXPO8DIg4kmR-vfmsbimn; charset=US-ASCII*
> > > Host: localhost:8081
> > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
> > > 
> > > ---------------------------------------------------------------
> > > ---------
> > > 
> > > The code is created through (https://github.com/apache/jme
> > > ter/blob/trunk/src/protocol/http/org/apache/jmeter/
> > > protocol/http/sampler/HTTPHC4Impl.java#L1201):
> > > 
> > > 1/            MultipartEntityBuilder multipartEntityBuilder =
> > > MultipartEntityBuilder.create();
> > > 
> > > 2/ As not Content Type is set in GUI, we default to US-ASCII so
> > > call:
> > > multipartEntityBuilder.setCharset("US-ASCII");
> > > 
> > > 3/
> > > multipartEntityBuilder.setLaxMode();
> > > 
> > > 4/ For every parameter:
> > >                 StringBody stringBody = new
> > > StringBody(arg.getValue(),
> > > ContentType.create("text/plain", charset));
> > >                 FormBodyPart formPart =
> > > FormBodyPartBuilder.create(
> > >                         parameterName, stringBody).build();
> > >                 multipartEntityBuilder.addPart(formPart);
> > > 
> > > 5/
> > >             HttpEntity entity = multipartEntityBuilder.build();
> > >             post.setEntity(entity);
> > > 
> > > 
> > > So my questions are the following:
> > > 1/ Is it correct to add this charset part ?
> > > 2/ Could you point me to the reference part of RFC that mentions
> > > this ?
> > > 3/ Is it correct to avoid setting charset in this case in API
> > > which would
> > > lead to such request instead ?
> > > 
> > > 
> > > 
> > > POST http://localhost:8081/
> > > 
> > > POST data:
> > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr
> > > Content-Disposition: form-data; name="toto"
> > > 
> > > titi
> > > --xjNHd_UhEEpqC2ZoFCpGRzYzHK90ljsdpfTr--
> > > 
> > > Request Headers:
> > > Connection: keep-alive
> > > Content-Length: 135
> > > Content-Type: multipart/form-data; boundary=xjNHd_UhEEpqC2ZoFCpGR
> > > zYzHK90ljsdpfTr
> > > Host: localhost:8081
> > > User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
> > > 
> > > 
> > > Thanks for your help
> > > Regards
> > > Philippe M.
> > > 
> > 
> > 
> > 
> > --
> > Cordialement.
> > Philippe Mouawad.
> > 
> > 
> > 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org