request method changed after 307 redirect

I’m trying to make a put request to a rest api which always 307 redirect. The original request is indeed PUT but the auto redirect request somehow become GET (according to the extraInfo in simulation.log). Is the redirected request not going to use the original request’s method?

Really? 307 shouldn’t be doing that: http://i23.mangareader.net/liar-game/195/liar-game-5347677.jpg
Which version do you use?

Woups, proper link: https://github.com/AsyncHttpClient/async-http-client/blob/1.9.x/src/main/java/com/ning/http/client/providers/netty/handler/Protocol.java#L147-L148

Hmm that’s strange. I use gatling2.0.0 so it is using ahc1.9 But see my simulation.log:

Rest 3331608238485911533-0 REQUEST setAway 1417705559728 1417705559900 1417705560260 1417705560260 OK PUTSome(307)true
Rest 3331608238485911533-0 REQUEST setAway Redirect 1 1417705560261 1417705560637 1417705560887 1417705560887 OK GETSome(200)false

And here’s my request:

exec(http(“setAway”)
.put("/structures/${structureId}/away")
.queryParam(“auth”, “${token}”)
.body(StringBody("“home”"))
)

And here’s the extraInfo:
.extraInfoExtractor(extraInfo => List(extraInfo.request.getMethod, extraInfo.response.statusCode, extraInfo.response.isRedirect))

Not sure if these are relevant, but my baseUrl is something like “https://api.example.com” and its Location is something like “https://host01.example.com:8888

Me stupid!
Gatling overrides AHC redirect handling…
Let me check.

Facepalm: https://github.com/gatling/gatling/blob/master/gatling-http/src/main/scala/io/gatling/http/ahc/AsyncHandlerActor.scala#L216-L219

Fixed: https://github.com/gatling/gatling/issues/2423

Thanks for reporting