At present, all redirected requests are forced to use GET. This is wrong, at the very least HEAD requests should remain as HEAD requests. The full rules are at: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3 Note: Many web sites say that 307 should retain the same method. However, AFAICT that was a proposal only as part of https://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#page-56 This has not been ratified, so JMeter should proceed as per RFC2616 for now.
JMeter 2.9 changes all methods to GET for the codes 301, 302, 303. It does not treat 307 as a redirect. According to the spec: 301 - should not automatically redirect except GET/HEAD; however some HTTP/1.0 agents do so (as does JMeter) 302 - should not automatically redirect except GET/HEAD; however most agents do so (incl. JMeter) 303 - should redirect POST using GET; JMeter does this. The spec is not clear if HEAD should be redirected as GET or if it should be redirected as HEAD. 307 - should not automatically redirect except GET/HEAD; It looks like the fixes needed are as follows: 301,301,303: change code so HEAD is redirected as HEAD. 307: add code to redirect IF method is GET or HEAD only, and keep the method unchanged.
Hello sebb, have a look at 54119 Regards Philippe
(In reply to Sebb from comment #1) > > 307: add code to redirect IF method is GET or HEAD only, and keep the method > unchanged. Oops, I see that 307 is already handled correctly; should have spotted that.
URL: http://svn.apache.org/r1515608 Log: HEAD redirects should remain as HEAD Bugzilla Id: 55450 Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java jmeter/trunk/xdocs/changes.xml
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3199