Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
[
    'url' => 'https://your.host.name',
    'requestMethod' => requestMethod::methodType,
    'dataType' => dataType::dataType,
    'data' => ['Your_data'=>'Array']
    'headers' => [
        'X-Request-Header-Key' => 'X-Request-Header-Value',
    ],
    'auth' => [
        'username'=>'username',
        'password'=>'password',
        'type' => authenticationType
    ]
]

The syntax very much looks like how the request()-method is actually built.

...

Code Block
languagephp
themeEmacs
$bodies = [];
while ($parsed = $wrapperFirst->getParsed()) {
    $bodies[] = $parsed;
}

Undocumented features

One thing that is currently untested is the user authentication in the multi requests. However, the data should work like the setAuthentication()-method usually do. In the setAuthentication()-request, we primarily requesting defaults, so by not setting authentication variables for each handle, but within the normal requests userdata will be fetched for all calls. In the below code-block we're currently demonstrating how the setAuthentication() fetches its userdata by overwriting the parent variable set, from the ConfigWrapper.

Code Block
languagephp
themeEmacs
$authData = $this->getAuthentication();
if (!is_null($urlData)) {
    if (isset($urlData['auth'])) {
        $authData = $urlData['auth'];
    }
}