You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Vladimir Lapacek <vl...@gmail.com> on 2006/08/31 14:34:02 UTC

changing Content-Type for HTTP POST request

Hello,

I have the following problem with JMeter.

I am using GWT (Google Web Toolkit) java framework for building web
apps. GWT encapsulates ajax http calls, sending ajax requests via POST
to server.

Server always expects content-type: text/plain; charset=utf-8. That is
problem because JMeter's http sampler changes headers. Even if I have
correct setting for Content-type in the http request sampler node,
JMeter changes this and sends Content-Type:
application/x-www-form-urlencoded instead. As I said this is problem
with GWT ajax calls. Is there any way how to make JMeter not to change
this header? I used HTTP Request Manager Config element but with no
success.

As a workaround I manually changed the source code, edited
org.apache.jmeter.protocol.http.sampler.PostWriter and commented line
which changes the header. But isn't there any other way? And why is
JMeter changing the header?

Vladimir



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: changing Content-Type for HTTP POST request

Posted by sebb <se...@gmail.com>.
On 31/08/06, Vladimir Lapacek <vl...@gmail.com> wrote:
> Hello,
>
> I have the following problem with JMeter.
>
> I am using GWT (Google Web Toolkit) java framework for building web
> apps. GWT encapsulates ajax http calls, sending ajax requests via POST
> to server.
>
> Server always expects content-type: text/plain; charset=utf-8. That is
> problem because JMeter's http sampler changes headers. Even if I have
> correct setting for Content-type in the http request sampler node,
> JMeter changes this and sends Content-Type:
> application/x-www-form-urlencoded instead. As I said this is problem
> with GWT ajax calls. Is there any way how to make JMeter not to change
> this header? I used HTTP Request Manager Config element but with no
> success.
>
> As a workaround I manually changed the source code, edited
> org.apache.jmeter.protocol.http.sampler.PostWriter and commented line
> which changes the header. But isn't there any other way? And why is

Not at present - please file a Bugzilla enhancement request.

> JMeter changing the header?

AFAIK, it's not using the header - it's setting the type directly,
because the type needs to be set for POST requests.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org