redirect_message


Description:

[ Version ( since = "2.38" ) ]
public bool redirect_message (Message msg)

Updates msg's URI according to its status code and "Location" header, and requeues it on this.

Use this when you have set NO_REDIRECT on a message, but have decided to allow a particular redirection to occur, or if you want to allow a redirection that Session will not perform automatically (eg, redirecting a non-safe method such as DELETE).

If msg's status code indicates that it should be retried as a GET request, then msg will be modified accordingly.

If msg has already been redirected too many times, this will cause it to fail with TOO_MANY_REDIRECTS.

Parameters:

this

the session

msg

a Message that has received a 3xx response

Returns:

true if a redirection was applied, false if not (eg, because there was no Location header, or it could not be parsed).