Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
Namespaces | |
namespace | Cookie |
| |
namespace | Exception |
| |
namespace | Handler |
| |
namespace | Promise |
| |
namespace | Psr7 |
| |
Classes | |
class | BodySummarizer |
interface | BodySummarizerInterface |
class | Client |
interface | ClientInterface |
class | MessageFormatter |
interface | MessageFormatterInterface |
class | Middleware |
class | Pool |
class | PrepareBodyMiddleware |
class | RedirectMiddleware |
class | RequestOptions |
class | RetryMiddleware |
class | TransferStats |
class | Utils |
Functions | |
choose_handler () | |
Chooses and creates a default handler to use based on the environment. | |
debug_resource ($value=null) | |
Returns a debug stream based on the provided variable. | |
default_ca_bundle () | |
Returns the default cacert bundle for the current system. | |
default_user_agent () | |
Get the default User-Agent string to use with Guzzle. | |
delete ($uri, array $options=[]) | |
Create and send an HTTP DELETE request. | |
deleteAsync ($uri, array $options=[]) | |
Create and send an asynchronous HTTP DELETE request. | |
describe_type ($input) | |
get ($uri, array $options=[]) | |
Create and send an HTTP GET request. | |
getAsync ($uri, array $options=[]) | |
Create and send an asynchronous HTTP GET request. | |
head ($uri, array $options=[]) | |
Create and send an HTTP HEAD request. | |
headAsync ($uri, array $options=[]) | |
Create and send an asynchronous HTTP HEAD request. | |
headers_from_lines (iterable $lines) | |
Parses an array of header lines into an associative array of headers. | |
is_host_in_noproxy (string $host, array $noProxyArray) | |
Returns true if the provided host matches any of the no proxy areas. | |
json_decode (string $json, bool $assoc=false, int $depth=512, int $options=0) | |
Wrapper for json_decode that throws when an error occurs. | |
json_encode ($value, int $options=0, int $depth=512) | |
Wrapper for JSON encoding that throws when an error occurs. | |
normalize_header_keys (array $headers) | |
Creates an associative array of lowercase header names to the actual header casing. | |
patch ($uri, array $options=[]) | |
Create and send an HTTP PATCH request. | |
patchAsync ($uri, array $options=[]) | |
Create and send an asynchronous HTTP PATCH request. | |
post ($uri, array $options=[]) | |
Create and send an HTTP POST request. | |
postAsync ($uri, array $options=[]) | |
Create and send an asynchronous HTTP POST request. | |
put ($uri, array $options=[]) | |
Create and send an HTTP PUT request. | |
putAsync ($uri, array $options=[]) | |
Create and send an asynchronous HTTP PUT request. | |
requestAsync (string $method, $uri, array $options=[]) | |
Create and send an asynchronous HTTP request. | |
Variables | |
trait | ClientTrait |
GuzzleHttp\choose_handler | ( | ) |
Chooses and creates a default handler to use based on the environment.
The returned handler is not wrapped by any default middlewares.
callable(\Psr\Http\Message\RequestInterface,array) | GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system. |
RuntimeException | if no viable Handler is available. |
GuzzleHttp\debug_resource | ( | $value = null | ) |
Returns a debug stream based on the provided variable.
mixed | $value | Optional value |
resource |
GuzzleHttp\default_ca_bundle | ( | ) |
Returns the default cacert bundle for the current system.
First, the openssl.cafile and curl.cainfo php.ini settings are checked. If those settings are not configured, then the common locations for bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X and Windows are checked. If any of these file locations are found on disk, they will be utilized.
Note: the result of this function is cached for subsequent calls.
RuntimeException | if no bundle can be found. |
GuzzleHttp\default_user_agent | ( | ) |
Get the default User-Agent string to use with Guzzle.
GuzzleHttp\delete | ( | $uri, | |
array | $options = [] ) |
Create and send an HTTP DELETE 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.
string | UriInterface | $uri | URI object or string. |
array | $options | Request options to apply. |
GuzzleException |
GuzzleHttp\deleteAsync | ( | $uri, | |
array | $options = [] ) |
Create and send an asynchronous HTTP DELETE 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.
string | UriInterface | $uri | URI object or string. |
array | $options | Request options to apply. |
GuzzleHttp\get | ( | $uri, | |
array | $options = [] ) |
Create and send an HTTP GET 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.
string | UriInterface | $uri | URI object or string. |
array | $options | Request options to apply. |
GuzzleException |
GuzzleHttp\getAsync | ( | $uri, | |
array | $options = [] ) |
Create and send an asynchronous HTTP GET 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.
string | UriInterface | $uri | URI object or string. |
array | $options | Request options to apply. |
GuzzleHttp\head | ( | $uri, | |
array | $options = [] ) |
Create and send an HTTP HEAD 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.
string | UriInterface | $uri | URI object or string. |
array | $options | Request options to apply. |
GuzzleException |
GuzzleHttp\headAsync | ( | $uri, | |
array | $options = [] ) |
Create and send an asynchronous HTTP HEAD 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.
string | UriInterface | $uri | URI object or string. |
array | $options | Request options to apply. |
GuzzleHttp\headers_from_lines | ( | iterable | $lines | ) |
Parses an array of header lines into an associative array of headers.
iterable | $lines | Header lines array of strings in the following format: "Name: Value" |
GuzzleHttp\is_host_in_noproxy | ( | string | $host, |
array | $noProxyArray ) |
Returns true if the provided host matches any of the no proxy areas.
This method will strip a port from the host if it is present. Each pattern can be matched with an exact match (e.g., "foo.com" == "foo.com") or a partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" == "baz.foo.com", but ".foo.com" != "foo.com").
Areas are matched in the following cases:
string | $host | Host to check against the patterns. |
string[] | $noProxyArray | An array of host patterns. |
Exception\InvalidArgumentException |
GuzzleHttp\json_decode | ( | string | $json, |
bool | $assoc = false, | ||
int | $depth = 512, | ||
int | $options = 0 ) |
Wrapper for json_decode that throws when an error occurs.
string | $json | JSON data to parse |
bool | $assoc | When true, returned objects will be converted into associative arrays. |
int | $depth | User specified recursion depth. |
int | $options | Bitmask of JSON decode options. |
object|array|string|int|float|bool|null |
Exception\InvalidArgumentException | if the JSON cannot be decoded. |
GuzzleHttp\json_encode | ( | $value, | |
int | $options = 0, | ||
int | $depth = 512 ) |
Wrapper for JSON encoding that throws when an error occurs.
mixed | $value | The value being encoded |
int | $options | JSON encode option bitmask |
int | $depth | Set the maximum depth. Must be greater than zero. |
Exception\InvalidArgumentException | if the JSON cannot be encoded. |
GuzzleHttp\normalize_header_keys | ( | array | $headers | ) |
Creates an associative array of lowercase header names to the actual header casing.
GuzzleHttp\patch | ( | $uri, | |
array | $options = [] ) |
Create and send an HTTP PATCH 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.
string | UriInterface | $uri | URI object or string. |
array | $options | Request options to apply. |
GuzzleException |
GuzzleHttp\patchAsync | ( | $uri, | |
array | $options = [] ) |
Create and send an asynchronous HTTP PATCH 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.
string | UriInterface | $uri | URI object or string. |
array | $options | Request options to apply. |
GuzzleHttp\post | ( | $uri, | |
array | $options = [] ) |
Create and send an HTTP POST 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.
string | UriInterface | $uri | URI object or string. |
array | $options | Request options to apply. |
GuzzleException |
GuzzleHttp\postAsync | ( | $uri, | |
array | $options = [] ) |
Create and send an asynchronous HTTP POST 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.
string | UriInterface | $uri | URI object or string. |
array | $options | Request options to apply. |
GuzzleHttp\put | ( | $uri, | |
array | $options = [] ) |
Create and send an HTTP PUT 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.
string | UriInterface | $uri | URI object or string. |
array | $options | Request options to apply. |
GuzzleException |
GuzzleHttp\putAsync | ( | $uri, | |
array | $options = [] ) |
Create and send an asynchronous HTTP PUT 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.
string | UriInterface | $uri | URI object or string. |
array | $options | Request options to apply. |
|
abstract |
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.
string | $method | HTTP method |
string | UriInterface | $uri | URI object or string. |
array | $options | Request options to apply. |
trait GuzzleHttp\ClientTrait |