Requests::parse_multiple() WordPress Method

The parse_multiple() method of the Requests class can be used to parse the responses of multiple WordPress requests into an array. This is useful for batch processing of data from WordPress.

Requests::parse_multiple( string $response, array $request ) #

Callback for transport.internal.parse_response


Description

Internal use only. Converts a raw HTTP response to a Requests_Response while still executing a multiple request.


Top ↑

Parameters

$response

(string)(Required)Full response text including headers and body (will be overwritten with Response instance)

$request

(array)(Required)Request data as passed into Requests::request_multiple()


Top ↑

Return

(null) $response is either set to a Requests_Response instance, or a Requests_Exception object


Top ↑

Source

File: wp-includes/class-requests.php

736
737
738
739
740
741
742
743
744
745
746
747
public static function parse_multiple(&$response, $request) {
    try {
        $url      = $request['url'];
        $headers  = $request['headers'];
        $data     = $request['data'];
        $options  = $request['options'];
        $response = self::parse_response($response, $url, $headers, $data, $options);
    }
    catch (Requests_Exception $e) {
        $response = $e;
    }
}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.