Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Client.php

function Client::request

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.

Parameters

string $method HTTP method.:

string|UriInterface $uri URI object or string.:

array $options Request options to apply. See \GuzzleHttp\RequestOptions.:

Throws

GuzzleException

Overrides ClientTrait::request

1 call to Client::request()
Client::__call in vendor/guzzlehttp/guzzle/src/Client.php

File

vendor/guzzlehttp/guzzle/src/Client.php, line 185

Class

Client
@final

Namespace

GuzzleHttp

Code

public function request(string $method, $uri = '', array $options = []) : ResponseInterface {
    $options[RequestOptions::SYNCHRONOUS] = true;
    return $this->requestAsync($method, $uri, $options)
        ->wait();
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal