Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

(no description)

File Size: 84 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ClientInterface:: (5 methods):
  send()
  sendAsync()
  request()
  requestAsync()
  getConfig()


Interface: ClientInterface  - X-Ref

Client interface for sending HTTP requests.

send(RequestInterface $request, array $options = [])   X-Ref
Send an HTTP request.

param: RequestInterface $request Request to send
param: array            $options Request options to apply to the given

sendAsync(RequestInterface $request, array $options = [])   X-Ref
Asynchronously send an HTTP request.

param: RequestInterface $request Request to send
param: array            $options Request options to apply to the given

request(string $method, $uri, array $options = [])   X-Ref
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.

requestAsync(string $method, $uri, array $options = [])   X-Ref
Create and send an asynchronous 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. Use an array to provide a URL
template and additional variables to use in the URL template expansion.

param: string              $method  HTTP method
param: string|UriInterface $uri     URI object or string.
param: array               $options Request options to apply.

getConfig(?string $option = null)   X-Ref
Get a client configuration option.

These options include default request options of the client, a "handler"
(if utilized by the concrete client), and a "base_uri" if utilized by
the concrete client.

param: string|null $option The config option to retrieve.
return: mixed