GC_Http::processResponse()

最后更新于:2021-12-01 11:13:39

GC_( string$strResponse)

Parses the responses and splits the parts into headers and body.

参数

$strResponse

(string) (Required) The full response string.

响应

(array) Array with response headers and body.

  • ‘headers’
    (string) HTTP response headers.
  • ‘body’
    (string) HTTP response body.

源文件

文件: gc-includes/class-http.php

	public static function processResponse( $strResponse ) { // phpcs:ignore GeChiUI.NamingConventions.ValidFunctionName.MethodNameInvalid
		$res = explode( "rnrn", $strResponse, 2 );

		return array(
			'headers' => $res[0],
			'body'    => isset( $res[1] ) ? $res[1] : '',
		);
	}