Session.redirectMessage

Updates @msg's URI according to its status code and "Location" header, and requeues it on @session. Use this when you have set %SOUP_MESSAGE_NO_REDIRECT on a message, but have decided to allow a particular redirection to occur, or if you want to allow a redirection that #SoupSession 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 %SOUP_STATUS_TOO_MANY_REDIRECTS.

class Session
bool
redirectMessage

Parameters

msg Message

a #SoupMessage that has received a 3xx response

Return Value

Type: bool

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

Meta

Since

2.38