You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by N Cocy <no...@gmail.com> on 2010/10/16 08:44:42 UTC

JMeter proxy gets resonse code 405 when POSTing a file

Hi, everyone.

I'm recording my test plan via JMeter proxy, but when I POST a file,
JMeter proxy gets response code 405 (Method Not Allowed), and gets
no reply page.
Without JMeter proxy, POSTing a file works fine and response code
gets 302 (Found), and the web page is successfully reloaded.

If I understand correctly, JMeter proxy is just a proxy and recording
the request/reply between the web server and browser. So it's just
working like a "Man In The Middle". Then, there shouldn't be difference
between with/without the proxy for the connection with the web server
and browser...

Does anybody have the same problem, or any suggestion?

Best Regards,
Koji

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


Re: JMeter proxy gets resonse code 405 when POSTing a file

Posted by N Cocy <no...@gmail.com>.
Dear All,

I found out by snooping the packet that the reply from the web server is
gzip-ed html which suggest to redirect to the same server's URL.
I think this is how the web application reload the page after the POST request.
But at this timing, if I used JMeter proxy, the reply from the web server
became 405 (Method Not Allowed).

I read JMeter's reference manual, and it is described that
"the JMeter sampler will check if the response is a redirect and
follow it if so" at the "Follow Redirects" attribute part.
(I, of course, disabled "Redirect Automatically" attribute when
setting the "Follow Redirects" attribute.)

So, I don't understand why JMeter proxy receive the 405 from
the web server.

I'm using the JMeter 2.4.

Any idea or suggestion?
If I could, I would rather modify the source code but I can't find
where/how to change the code.

Thanks and Best Regards,
Koji

On Sat, Oct 16, 2010 at 3:44 PM, N Cocy <no...@gmail.com> wrote:
> Hi, everyone.
>
> I'm recording my test plan via JMeter proxy, but when I POST a file,
> JMeter proxy gets response code 405 (Method Not Allowed), and gets
> no reply page.
> Without JMeter proxy, POSTing a file works fine and response code
> gets 302 (Found), and the web page is successfully reloaded.
>
> If I understand correctly, JMeter proxy is just a proxy and recording
> the request/reply between the web server and browser. So it's just
> working like a "Man In The Middle". Then, there shouldn't be difference
> between with/without the proxy for the connection with the web server
> and browser...
>
> Does anybody have the same problem, or any suggestion?
>
> Best Regards,
> Koji
>

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


Re: JMeter proxy gets resonse code 405 when POSTing a file

Posted by N Cocy <no...@gmail.com>.
> But a file wasn't uploaded by running the the recorded test simulation........

My apologies, that is different issue from JMeter proxy.
That was the issue of authenticity_token of the ruby on rails.
Just FYI.


On Sun, Oct 17, 2010 at 9:15 PM, N Cocy <no...@gmail.com> wrote:
> By comparing the packet with JMeter proxy and without JMeter proxy,
> I've commented out unnecessary (for Rails) properties in following java file
> and recompile JMeter.
>
> -----
> src\protocol\http\org\apache\jmeter\protocol\http\sampler\PostWriter.java
>        writeStartFileMultipart()
>        //writeln(out, "Content-Transfer-Encoding: binary"); // $NON-NLS-1$
>
>        writeFormMultipart()
>        /*****
>        writeln(out, "Content-Type: text/plain; charset=" + charSet); // $NON-NLS-1$
>        writeln(out, "Content-Transfer-Encoding: 8bit"); // $NON-NLS-1$
>        *****/
> ------
>
> Now, I successfully upload a file by multipart post through JMeter proxy.
> But a file wasn't uploaded by running the the recorded test simulation........
>

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


Re: JMeter proxy gets resonse code 405 when POSTing a file

Posted by N Cocy <no...@gmail.com>.
By comparing the packet with JMeter proxy and without JMeter proxy,
I've commented out unnecessary (for Rails) properties in following java file
and recompile JMeter.

-----
src\protocol\http\org\apache\jmeter\protocol\http\sampler\PostWriter.java
	writeStartFileMultipart()
	//writeln(out, "Content-Transfer-Encoding: binary"); // $NON-NLS-1$
	
	writeFormMultipart()
	/*****
	writeln(out, "Content-Type: text/plain; charset=" + charSet); // $NON-NLS-1$
	writeln(out, "Content-Transfer-Encoding: 8bit"); // $NON-NLS-1$
	*****/
------

Now, I successfully upload a file by multipart post through JMeter proxy.
But a file wasn't uploaded by running the the recorded test simulation........

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


Re: JMeter proxy gets resonse code 405 when POSTing a file

Posted by N Cocy <no...@gmail.com>.
Hi, thanks for your reply.

Regarding following discussion, the problem of POSTing multipart form against
rails application seems the matter of the rails side problem.

http://stackoverflow.com/questions/1947315/load-testing-multipart-form

Does anyone know the way to customize JMeter let to understand the
rails application, because I haven't authorized to change the rails application.

Regards,
Koji

On Sat, Oct 16, 2010 at 6:09 PM, Paul Loy <ke...@gmail.com> wrote:
> Multipart form posts with files also failed for me through the JMeter proxy.
> Although it failed, all I needed was the request and parameters so it didn't
> really matter.
>
> On Sat, Oct 16, 2010 at 7:44 AM, N Cocy <no...@gmail.com> wrote:
>
>> Hi, everyone.
>>
>> I'm recording my test plan via JMeter proxy, but when I POST a file,
>> JMeter proxy gets response code 405 (Method Not Allowed), and gets
>> no reply page.
>> Without JMeter proxy, POSTing a file works fine and response code
>> gets 302 (Found), and the web page is successfully reloaded.
>>
>> If I understand correctly, JMeter proxy is just a proxy and recording
>> the request/reply between the web server and browser. So it's just
>> working like a "Man In The Middle". Then, there shouldn't be difference
>> between with/without the proxy for the connection with the web server
>> and browser...
>>
>> Does anybody have the same problem, or any suggestion?
>>
>> Best Regards,
>> Koji
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>
>
> --
> ---------------------------------------------
> Paul Loy
> paul@keteracel.com
> http://uk.linkedin.com/in/paulloy
>

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


Re: JMeter proxy gets resonse code 405 when POSTing a file

Posted by Paul Loy <ke...@gmail.com>.
Multipart form posts with files also failed for me through the JMeter proxy.
Although it failed, all I needed was the request and parameters so it didn't
really matter.

On Sat, Oct 16, 2010 at 7:44 AM, N Cocy <no...@gmail.com> wrote:

> Hi, everyone.
>
> I'm recording my test plan via JMeter proxy, but when I POST a file,
> JMeter proxy gets response code 405 (Method Not Allowed), and gets
> no reply page.
> Without JMeter proxy, POSTing a file works fine and response code
> gets 302 (Found), and the web page is successfully reloaded.
>
> If I understand correctly, JMeter proxy is just a proxy and recording
> the request/reply between the web server and browser. So it's just
> working like a "Man In The Middle". Then, there shouldn't be difference
> between with/without the proxy for the connection with the web server
> and browser...
>
> Does anybody have the same problem, or any suggestion?
>
> Best Regards,
> Koji
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


-- 
---------------------------------------------
Paul Loy
paul@keteracel.com
http://uk.linkedin.com/in/paulloy