Application
Interfaces, Classes, Traits and Enums
- BodySummarizerInterface
- ClientInterface
- Client interface for sending HTTP requests.
- CookieJarInterface
- Stores HTTP cookies.
- GuzzleException
- CurlFactoryInterface
- MessageFormatterInterface
- BodySummarizer
- Client
- CookieJar
- Cookie jar that stores cookies as an array
- FileCookieJar
- Persists non-session cookies using a JSON formatted file
- SessionCookieJar
- Persists cookies in the client session
- SetCookie
- Set-Cookie object
- BadResponseException
- Exception when an HTTP error occurs (4xx or 5xx error)
- ClientException
- Exception when a client error is encountered (4xx codes)
- ConnectException
- Exception thrown when a connection cannot be established.
- InvalidArgumentException
- RequestException
- HTTP Request exception
- ServerException
- Exception when a server error is encountered (5xx codes)
- TooManyRedirectsException
- HTTP Request exception
- TransferException
- CurlFactory
- Creates curl resources from a request
- CurlHandler
- HTTP handler that uses cURL easy handles as a transport layer.
- CurlMultiHandler
- Returns an asynchronous response using curl_multi_* functions.
- MockHandler
- Handler that returns responses or throw exceptions from a queue.
- Proxy
- Provides basic proxies for handlers.
- StreamHandler
- HTTP handler that uses PHP's HTTP stream wrapper.
- HandlerStack
- Creates a composed Guzzle handler function by stacking middlewares on top of an HTTP handler function.
- MessageFormatter
- Formats log messages using variable substitutions for requests, responses, and other transactional data.
- Middleware
- Functions used to create and wrap handlers with handler middleware.
- Pool
- Sends an iterator of requests concurrently using a capped pool size.
- PrepareBodyMiddleware
- Prepares requests that contain a body, adding the Content-Length, Content-Type, and Expect headers.
- RedirectMiddleware
- Request redirect middleware.
- RequestOptions
- This class contains a list of built-in Guzzle request options.
- RetryMiddleware
- Middleware that retries requests based on the boolean result of invoking the provided "decider" function.
- TransferStats
- Represents data at the point after it was transferred either successfully or after a network error.
- Utils
- ClientTrait
- Client interface for sending HTTP requests.
Table of Contents
- describe_type() : string
- Debug function used to describe the provided value type and class.
- headers_from_lines() : array<string|int, mixed>
- Parses an array of header lines into an associative array of headers.
- debug_resource() : resource
- Returns a debug stream based on the provided variable.
- choose_handler() : callable
- Chooses and creates a default handler to use based on the environment.
- default_user_agent() : string
- Get the default User-Agent string to use with Guzzle.
- default_ca_bundle() : string
- Returns the default cacert bundle for the current system.
- normalize_header_keys() : array<string|int, mixed>
- Creates an associative array of lowercase header names to the actual header casing.
- is_host_in_noproxy() : bool
- Returns true if the provided host matches any of the no proxy areas.
- json_decode() : object|array<string|int, mixed>|string|int|float|bool|null
- Wrapper for json_decode that throws when an error occurs.
- json_encode() : string
- Wrapper for JSON encoding that throws when an error occurs.
Functions
describe_type()
Debug function used to describe the provided value type and class.
describe_type(mixed $input) : string
Parameters
- $input : mixed
-
Any type of variable to describe the type of. This parameter misses a typehint because of that.
Tags
Return values
string —Returns a string containing the type of the variable and if a class is provided, the class name.
headers_from_lines()
Parses an array of header lines into an associative array of headers.
headers_from_lines(iteratable<string|int, mixed> $lines) : array<string|int, mixed>
Parameters
- $lines : iteratable<string|int, mixed>
-
Header lines array of strings in the following format: "Name: Value"
Tags
Return values
array<string|int, mixed> —debug_resource()
Returns a debug stream based on the provided variable.
debug_resource([mixed $value = null ]) : resource
Parameters
- $value : mixed = null
-
Optional value
Tags
Return values
resource —choose_handler()
Chooses and creates a default handler to use based on the environment.
choose_handler() : callable
The returned handler is not wrapped by any default middlewares.
Tags
Return values
callable —default_user_agent()
Get the default User-Agent string to use with Guzzle.
default_user_agent() : string
Tags
Return values
string —default_ca_bundle()
Returns the default cacert bundle for the current system.
default_ca_bundle() : string
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.
Tags
Return values
string —normalize_header_keys()
Creates an associative array of lowercase header names to the actual header casing.
normalize_header_keys(array<string|int, mixed> $headers) : array<string|int, mixed>
Parameters
- $headers : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —is_host_in_noproxy()
Returns true if the provided host matches any of the no proxy areas.
is_host_in_noproxy(string $host, array<string|int, string> $noProxyArray) : bool
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:
- "*" (without quotes) always matches any hosts.
- An exact match.
- The area starts with "." and the area is the last part of the host. e.g. '.mit.edu' will match any host that ends with '.mit.edu'.
Parameters
- $host : string
-
Host to check against the patterns.
- $noProxyArray : array<string|int, string>
-
An array of host patterns.
Tags
Return values
bool —json_decode()
Wrapper for json_decode that throws when an error occurs.
json_decode(string $json[, bool $assoc = false ][, int $depth = 512 ], int $options) : object|array<string|int, mixed>|string|int|float|bool|null
Parameters
- $json : string
-
JSON data to parse
- $assoc : bool = false
-
When true, returned objects will be converted into associative arrays.
- $depth : int = 512
-
User specified recursion depth.
- $options : int
-
Bitmask of JSON decode options.
Tags
Return values
object|array<string|int, mixed>|string|int|float|bool|null —json_encode()
Wrapper for JSON encoding that throws when an error occurs.
json_encode(mixed $value, int $options[, int $depth = 512 ]) : string
Parameters
- $value : mixed
-
The value being encoded
- $options : int
-
JSON encode option bitmask
- $depth : int = 512
-
Set the maximum depth. Must be greater than zero.