Summery Summery

Match redirect behaviour to browser handling.

Syntax Syntax

WP_Http::browser_redirect_compatibility( string $location, array $headers, string|array $data, array $options, Requests_Response $original )

Description Description

Changes 302 redirects from POST to GET to match browser handling. Per RFC 7231, user agents can deviate from the strict reading of the specification for compatibility purposes.

Parameters Parameters


(string) (Required) URL to redirect to.


(array) (Required) Headers for the redirect.


(string|array) (Required) Body to send with the request.


(array) (Required) Redirect request options.


(Requests_Response) (Required) Response object.

Source Source

File: wp-includes/class-http.php

	public static function browser_redirect_compatibility( $location, $headers, $data, &$options, $original ) {
		// Browser compatibility.
		if ( 302 === $original->status_code ) {
			$options['type'] = Requests::GET;


Changelog Changelog

Version Description
4.6.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.