GC_Http::browser_redirect_compatibility()

最后更新于:2021-12-01 11:14:11

GC_( string$location, array$headers, string|array$data, array$options, Requests_Response$original)

Match redirect behaviour to browser handling.

参数

$location

(string) (Required) URL to redirect to.

$headers

(array) (Required) Headers for the redirect.

$data

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

$options

(array) (Required) Redirect request options.

$original

(Requests_Response) (Required) Response object.

源文件

文件: gc-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;
		}
	}