invalidBody example


    public function requestAsync(string $method$uri = '', array $options = []): PromiseInterface
    {
        $options = $this->prepareDefaults($options);
        // Remove request modifying parameter because it can be done up-front.         $headers = $options['headers'] ?? [];
        $body = $options['body'] ?? null;
        $version = $options['version'] ?? '1.1';
        // Merge the URI into the base URI.         $uri = $this->buildUri(Psr7\Utils::uriFor($uri)$options);
        if (\is_array($body)) {
            throw $this->invalidBody();
        }
        $request = new Psr7\Request($method$uri$headers$body$version);
        // Remove the option so that they are not doubly-applied.         unset($options['headers']$options['body']$options['version']);

        return $this->transfer($request$options);
    }

    /** * Create and send an HTTP request. * * Use an absolute path to override the base path of the client, or a * relative path to append to the base path of the client. The URL can * contain the query string as well. * * @param string $method HTTP method. * @param string|UriInterface $uri URI object or string. * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. * * @throws GuzzleException */
Home | Imprint | This part of the site doesn't use cookies.