WpOrg\Requests
Session::request_multiple()
Send multiple HTTP requests simultaneously
Method of the class: Session{}
No Hooks.
Return
Array
. Responses (either \WpOrg\Requests\Response or a \WpOrg\Requests\Exception object)
Usage
$Session = new Session(); $Session->request_multiple( $requests, $options );
- $requests(array) (required)
- Requests data (see \WpOrg\Requests\Requests::request_multiple())
- $options(array)
- Global and default options (see \WpOrg\Requests\Requests::request())
Default: []
Notes
- See: \WpOrg\Requests[Requests::request_multiple()](/function/Requests::request_multiple)
Session::request_multiple() Session::request multiple code WP 6.6.2
public function request_multiple($requests, $options = []) { if (InputValidator::has_array_access($requests) === false || InputValidator::is_iterable($requests) === false) { throw InvalidArgument::create(1, '$requests', 'array|ArrayAccess&Traversable', gettype($requests)); } if (is_array($options) === false) { throw InvalidArgument::create(2, '$options', 'array', gettype($options)); } foreach ($requests as $key => $request) { $requests[$key] = $this->merge_request($request, false); } $options = array_merge($this->options, $options); // Disallow forcing the type, as that's a per request setting unset($options['type']); return Requests::request_multiple($requests, $options); }