class PendingRequest

Traits

Every request and pending request uses this trait, so body traits need no upstream HasBody contract or ChecksForHasBody check.

Properties

protected Authenticator|null $authenticator

The authenticator used in requests.

from  AuthenticatesRequests
protected BodyRepository|null $bodyRepository

The request body repository.

from  HasBody
protected list<array<string, mixed>> $cookies

The request cookies and their attributes.

from  HasCookies
protected int|null $delay

The request delay in milliseconds.

from  HasDelay
protected ArrayRepository|null $headerRepository

The request headers.

from  HasHeaders
protected MiddlewarePipeline|null $middlewarePipeline

The request middleware pipeline.

from  HasMiddleware
protected ArrayRepository|null $optionRepository

The request options.

from  HasOptions
protected ArrayRepository|null $queryRepository

The request query parameters.

from  HasQuery
protected string|null $queryString

The already-encoded query string override.

from  HasQuery
protected RetryPolicy|null $retryPolicy

The request retry policy.

from  HasRetryPolicy
protected array<array-key, mixed> $urlParameters

The parameters substituted into URL templates.

from  HasUrlParameters
static protected array $macros

The registered string macros.

from  Macroable
protected Method $method

The HTTP method used by the operation.

protected string|null $url

The absolute URL override.

protected UriInterface|null $uri

The finalized request URI.

protected StreamInterface|null $preparedBody

The prepared request body.

protected bool $bodyPrepared

Whether the operation body has been prepared.

protected int|null $attemptBodyOffset

The body offset at the start of the transport attempt.

protected RequestInterface|null $psrRequest

The final application-owned PSR request.

protected PendingRequest): void> $psrRequestObservers

The final PSR request observers.

protected array<string, true> $authenticationHeaderNames

The header names restricted to the request's origin.

protected bool $authenticating

Whether header writes belong to an authenticator.

protected null|array{0: string, 1: string, 2?: string} $transportAuthentication

The dedicated transport authentication option.

protected null|array{0: string, 1: string}|string $certificate

The dedicated client certificate option.

protected FakeResponse|null $fakeResponse

The response supplied by request middleware or a mock client.

protected bool $bootingPlugins

Whether the connector and request plugins are booting.

Methods

defaultAuth()

Resolve the default authenticator.

authenticator()

Get the authenticator.

authenticate(Authenticator $authenticator)

Authenticate the pending request.

withToken(string $token, string $type = 'Bearer')

Authenticate the request with a token.

withBasicAuth(string $username, string $password)

Authenticate the request with basic authentication.

withDigestAuth(string $username, string $password)

Authenticate the request with digest authentication.

mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

withBody(mixed $content, string|null $contentType = 'application/json')

Set the raw request body.

from  HasBody
asJson(array $data = [])

Use a JSON request body.

from  HasBody
asForm(array $data = [])

Use a URL-encoded form request body.

from  HasBody
asMultipart()

Use a multipart request body, keeping any existing multipart values.

from  HasBody
attach(array|string $name, mixed $contents = '', string|null $filename = null, array $headers = [])

Attach a multipart value to the request.

from  HasBody
withData(array $data)

Merge structured values into the request body.

from  HasBody
mixed
body()

Get the resolved request body value.

from  HasBody
bool
hasBody()

Determine if the request has a body repository.

from  HasBody
copyBodyRepository()

Copy the body repository for a pending request.

from  HasBody
defaultBodyRepository()

Resolve the default body repository.

from  HasBody
bodyRepository()

Get the request body repository.

from  HasBody
debugRequest(callable|null $onRequest = null, bool $die = false)

Debug the final application-owned request.

debugResponse(callable|null $onResponse = null, bool $die = false)

Debug the response before ordinary response middleware.

debug(bool $die = false)

Debug both the request and response.

withCookie(SetCookie $cookie)

Specify a cookie and its attributes for the request.

withCookies(array $cookies, string $domain)

Specify cookies that should be included with the request.

array
cookies()

Get the request cookies and their attributes.

delay(int $milliseconds)

Delay the request by the given milliseconds.

from  HasDelay
int|null
delayMilliseconds()

Get the request delay in milliseconds.

from  HasDelay
int|null
defaultDelay()

Resolve the default request delay.

from  HasDelay
array
headers()

Get the request headers.

bool
hasHeader(string $name)

Determine if the request contains the given header.

withHeaders(array $headers)

Add headers to the request.

withHeader(string $name, mixed $value)

Add a header to the request.

replaceHeaders(array $headers)

Replace matching headers on the request.

withoutHeader(string $name)

Remove a header from the request.

withoutHeaders(array $names)

Remove the given headers from the request.

contentType(string $contentType)

Specify the request content type.

acceptJson()

Indicate that JSON should be returned by the server.

accept(string $contentType)

Indicate the type of content that should be returned by the server.

withUserAgent(bool|string $userAgent)

Specify the request user agent.

array
defaultHeaders()

Resolve the default request headers.

headerRepository()

Get the request header repository.

middleware()

Get the request middleware pipeline.

array
options()

Get the request options.

withOptions(array $options)

Add options to the request.

withoutOptions(array|string $keys)

Remove the given options from the request.

maxRedirects(int $max)

Specify the maximum number of redirects to allow.

withoutRedirecting()

Indicate that redirects should not be followed.

withoutVerifying()

Indicate that TLS certificates should not be verified.

sink(resource|StreamInterface|string $to)

Specify where the response body should be stored.

timeout(float|int $seconds)

Specify the request timeout in seconds.

connectTimeout(float|int $seconds)

Specify the connection timeout in seconds.

withTelescopeTags(array $tags)

Add Telescope tags to the request.

withoutTelescope()

Disable Telescope recording for the request.

array
defaultOptions()

Resolve the default request options.

optionRepository()

Get the request option repository.

string|null
queryString()

Get the raw query string override, without a leading question mark.

from  HasQuery
withQueryString(string $query)

Replace the raw query string and invalidate the finalized URI.

array
queryParameters()

Get the request query parameters.

from  HasQuery
withQueryParameters(array $parameters)

Add query parameters to the request.

withoutQueryParameters(array|string $keys)

Remove query parameters and invalidate the finalized URI.

array
defaultQuery()

Resolve the default request query parameters.

from  HasQuery
string|null
defaultQueryString()

Resolve the default raw query string override.

from  HasQuery
queryRepository()

Get the request query repository.

from  HasQuery
retry(array|int $times, Closure|int $sleepMilliseconds = 0, callable|null $when = null, bool $throw = true)

Specify the number of times the request should be attempted.

retryPolicy()

Get the request retry policy.

defaultRetryPolicy()

Resolve the default retry policy.

array
urlParameters()

Get the parameters substituted into URL templates.

withUrlParameters(array $parameters = [])

Specify the URL parameters and invalidate the finalized URI.

static void
macro(string $name, callable|object $macro)

Register a custom macro.

static void
mixin(object $mixin, bool $replace = true)

Mix another object into the class.

static bool
hasMacro(string $name)

Check if macro is registered.

static void
flushMacros()

Flush the existing macros.

static mixed
__callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

mixed
__call(string $method, array $parameters)

Dynamically handle calls to the class.

__construct(Connector $connector, Request $request)

Create a side-effect-free pending request.

connector()

Get the connector.

request()

Get the request.

Method
method()

Get the HTTP method.

withMethod(Method $method)

Change the HTTP method used by the operation.

string|null
url()

Get the absolute URL override.

withUrl(string $url)

Replace the connector base URL and request endpoint for this operation.

UriInterface
uri()

Get the final request URI.

finalizeUri()

Finalize the request URI after ordinary request middleware.

applyAuthentication()

Apply the selected authenticator.

void
setAuthentication(Authenticator $authenticator)

Apply an authenticator while recording its header writes.

bootPlugins()

Boot the connector and request plugins.

mergeMiddleware(MiddlewarePipeline $middleware)

Merge global or request middleware into this operation's own pipeline.

executeRequestPipeline()

Execute the request middleware pipeline.

executeResponsePipeline(Response $response)

Execute the response middleware pipeline.

void
executeFatalPipeline(FatalRequestException $exception)

Execute the fatal exception middleware pipeline.

prepareBody()

Prepare the request body after ordinary request middleware.

StreamInterface|null
preparedBody()

Get the prepared request body.

void
recordAuthenticationHeaders(array $headers)

Record headers written during authentication, including unchanged values.

array
authenticationHeaderNames()

Get the authentication header names.

setTransportAuthentication(array $authentication)

Set the dedicated transport authentication option.

array|null
transportAuthentication()

Get the dedicated transport authentication option.

setCertificate(string $path, string|null $password = null)

Set the client certificate option.

array|string|null
certificate()

Get the client certificate option.

observePsrRequest(callable $observer)

Observe the final application-owned PSR request.

RequestInterface
handlePsrRequest(RequestInterface $request)

Apply the connector and request PSR hooks.

void
notifyPsrRequestObservers(RequestInterface $request)

Notify the final PSR request observers.

RequestInterface
createPsrRequest()

Create the logical PSR request for a short-circuit response.

setPsrRequest(RequestInterface $request)

Set the final application-owned PSR request.

RequestInterface
toPsrRequest()

Get the captured PSR request or create a logical snapshot.

bool
restoreAttemptBody()

Restore the attempt body before another attempt.

setFakeResponse(FakeResponse|null $fakeResponse)

Set the fake response.

fakeResponse()

Get the fake response.

validateCachingConfiguration()

Validate the request's caching configuration.

bool
isCacheable()

Determine if this operation is cacheable.

bool
shouldInvalidateCache()

Determine if the matching cache entry should be invalidated.

cacheFor()

Get the cache duration.

UnitEnum|string|null
cacheStore()

Get the selected cache store.

string|null
resolveCacheKey()

Resolve the custom cache key.

Cacheable|null
cacheableResource()

Resolve the request or connector that owns cache duration and storage.

createResponse(Response $response, RequestInterface $request)

Create the response selected by this operation.

string|null
resolveResponseClass(Response $response)

Resolve the custom response class.

int|null
streamOffset(StreamInterface|null $stream)

Get the current offset of a seekable stream.

string|null
multipartContentType()

Resolve the multipart content type unless the caller provided one with a boundary.

static void
flushState()

Flush all static state.

Details

protected Authenticator|null defaultAuth()

Resolve the default authenticator.

Return Value

Authenticator|null

Authenticator|null authenticator()

Get the authenticator.

Return Value

Authenticator|null

at line 340
PendingRequest authenticate(Authenticator $authenticator)

Authenticate the pending request.

The authenticator is applied immediately, except while plugins boot: it is then applied once every plugin has booted.

Parameters

Authenticator $authenticator

Return Value

PendingRequest

AuthenticatesRequests withToken(string $token, string $type = 'Bearer')

Authenticate the request with a token.

Parameters

string $token
string $type

Return Value

AuthenticatesRequests

AuthenticatesRequests withBasicAuth(string $username, string $password)

Authenticate the request with basic authentication.

Parameters

string $username
string $password

Return Value

AuthenticatesRequests

AuthenticatesRequests withDigestAuth(string $username, string $password)

Authenticate the request with digest authentication.

Parameters

string $username
string $password

Return Value

AuthenticatesRequests

in Conditionable at line 23
mixed when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

in Conditionable at line 56
mixed unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

in HasBody at line 36
HasBody withBody(mixed $content, string|null $contentType = 'application/json')

Set the raw request body.

Parameters

mixed $content
string|null $contentType

Return Value

HasBody

in HasBody at line 55
HasBody asJson(array $data = [])

Use a JSON request body.

Parameters

array $data

Return Value

HasBody

in HasBody at line 68
HasBody asForm(array $data = [])

Use a URL-encoded form request body.

Parameters

array $data

Return Value

HasBody

in HasBody at line 80
HasBody asMultipart()

Use a multipart request body, keeping any existing multipart values.

Return Value

HasBody

in HasBody at line 97
HasBody attach(array|string $name, mixed $contents = '', string|null $filename = null, array $headers = [])

Attach a multipart value to the request.

Parameters

array|string $name
mixed $contents
string|null $filename
array $headers

Return Value

HasBody

in HasBody at line 129
HasBody withData(array $data)

Merge structured values into the request body.

A multipart body receives each value as an appended field.

Parameters

array $data

Return Value

HasBody

in HasBody at line 154
mixed body()

Get the resolved request body value.

Return Value

mixed

in HasBody at line 162
bool hasBody()

Determine if the request has a body repository.

Return Value

bool

in HasBody at line 172
final BodyRepository|null copyBodyRepository()

internal  
 

Copy the body repository for a pending request.

Return Value

BodyRepository|null

in HasBody at line 182
protected BodyRepository|null defaultBodyRepository()

Resolve the default body repository.

Return Value

BodyRepository|null

in HasBody at line 190
protected BodyRepository|null bodyRepository()

Get the request body repository.

Return Value

BodyRepository|null

in HasDebugging at line 22
HasDebugging debugRequest(callable|null $onRequest = null, bool $die = false)

Debug the final application-owned request.

Parameters

callable|null $onRequest
bool $die

Return Value

HasDebugging

in HasDebugging at line 50
HasDebugging debugResponse(callable|null $onResponse = null, bool $die = false)

Debug the response before ordinary response middleware.

Parameters

callable|null $onResponse
bool $die

Return Value

HasDebugging

in HasDebugging at line 81
HasDebugging debug(bool $die = false)

Debug both the request and response.

Raw debugging output may contain credentials or other sensitive values.

Parameters

bool $die

Return Value

HasDebugging

in HasCookies at line 25
HasCookies withCookie(SetCookie $cookie)

Specify a cookie and its attributes for the request.

Parameters

SetCookie $cookie

Return Value

HasCookies

in HasCookies at line 46
HasCookies withCookies(array $cookies, string $domain)

Specify cookies that should be included with the request.

Parameters

array $cookies
string $domain

Return Value

HasCookies

in HasCookies at line 60
array cookies()

Get the request cookies and their attributes.

Return Value

array

in HasDelay at line 21
HasDelay delay(int $milliseconds)

Delay the request by the given milliseconds.

Parameters

int $milliseconds

Return Value

HasDelay

in HasDelay at line 35
int|null delayMilliseconds()

Get the request delay in milliseconds.

Return Value

int|null

in HasDelay at line 43
protected int|null defaultDelay()

Resolve the default request delay.

Return Value

int|null

in HasHeaders at line 21
array headers()

Get the request headers.

Return Value

array

in HasHeaders at line 29
bool hasHeader(string $name)

Determine if the request contains the given header.

Parameters

string $name

Return Value

bool

at line 478
PendingRequest withHeaders(array $headers)

Add headers to the request.

Parameters

array $headers

Return Value

PendingRequest

in HasHeaders at line 58
HasHeaders withHeader(string $name, mixed $value)

Add a header to the request.

Parameters

string $name
mixed $value

Return Value

HasHeaders

at line 492
PendingRequest replaceHeaders(array $headers)

Replace matching headers on the request.

Parameters

array $headers

Return Value

PendingRequest

in HasHeaders at line 97
HasHeaders withoutHeader(string $name)

Remove a header from the request.

Parameters

string $name

Return Value

HasHeaders

in HasHeaders at line 108
HasHeaders withoutHeaders(array $names)

Remove the given headers from the request.

Parameters

array $names

Return Value

HasHeaders

in HasHeaders at line 126
HasHeaders contentType(string $contentType)

Specify the request content type.

Parameters

string $contentType

Return Value

HasHeaders

in HasHeaders at line 136
HasHeaders acceptJson()

Indicate that JSON should be returned by the server.

Return Value

HasHeaders

in HasHeaders at line 146
HasHeaders accept(string $contentType)

Indicate the type of content that should be returned by the server.

Parameters

string $contentType

Return Value

HasHeaders

in HasHeaders at line 156
HasHeaders withUserAgent(bool|string $userAgent)

Specify the request user agent.

Parameters

bool|string $userAgent

Return Value

HasHeaders

in HasHeaders at line 166
protected array defaultHeaders()

Resolve the default request headers.

Return Value

array

in HasHeaders at line 174
protected ArrayRepository headerRepository()

Get the request header repository.

Return Value

ArrayRepository

in HasMiddleware at line 19
MiddlewarePipeline middleware()

Get the request middleware pipeline.

Return Value

MiddlewarePipeline

in HasOptions at line 23
array options()

Get the request options.

Return Value

array

in HasOptions at line 34
HasOptions withOptions(array $options)

Add options to the request.

Parameters

array $options

Return Value

HasOptions

in HasOptions at line 47
HasOptions withoutOptions(array|string $keys)

Remove the given options from the request.

Parameters

array|string $keys

Return Value

HasOptions

in HasOptions at line 59
HasOptions maxRedirects(int $max)

Specify the maximum number of redirects to allow.

Parameters

int $max

Return Value

HasOptions

in HasOptions at line 77
HasOptions withoutRedirecting()

Indicate that redirects should not be followed.

Return Value

HasOptions

in HasOptions at line 87
HasOptions withoutVerifying()

Indicate that TLS certificates should not be verified.

Return Value

HasOptions

in HasOptions at line 98
HasOptions sink(resource|StreamInterface|string $to)

Specify where the response body should be stored.

Parameters

resource|StreamInterface|string $to

Return Value

HasOptions

in HasOptions at line 108
HasOptions timeout(float|int $seconds)

Specify the request timeout in seconds.

Parameters

float|int $seconds

Return Value

HasOptions

in HasOptions at line 118
HasOptions connectTimeout(float|int $seconds)

Specify the connection timeout in seconds.

Parameters

float|int $seconds

Return Value

HasOptions

in HasOptions at line 129
HasOptions withTelescopeTags(array $tags)

Add Telescope tags to the request.

Parameters

array $tags

Return Value

HasOptions

in HasOptions at line 139
HasOptions withoutTelescope()

Disable Telescope recording for the request.

Return Value

HasOptions

in HasOptions at line 149
protected array defaultOptions()

Resolve the default request options.

Return Value

array

in HasOptions at line 157
protected ArrayRepository optionRepository()

Get the request option repository.

Return Value

ArrayRepository

in HasQuery at line 24
string|null queryString()

Get the raw query string override, without a leading question mark.

Return Value

string|null

at line 325
PendingRequest withQueryString(string $query)

Replace the raw query string and invalidate the finalized URI.

Parameters

string $query

Return Value

PendingRequest

in HasQuery at line 44
array queryParameters()

Get the request query parameters.

Return Value

array

at line 297
PendingRequest withQueryParameters(array $parameters)

Add query parameters to the request.

Parameters

array $parameters

Return Value

PendingRequest

at line 314
PendingRequest withoutQueryParameters(array|string $keys)

Remove query parameters and invalidate the finalized URI.

Only values added through the query parameter methods are removed. Values embedded in the base URL, endpoint or raw query string are unchanged.

Parameters

array|string $keys

Return Value

PendingRequest

in HasQuery at line 83
protected array defaultQuery()

Resolve the default request query parameters.

Return Value

array

in HasQuery at line 91
protected string|null defaultQueryString()

Resolve the default raw query string override.

Return Value

string|null

in HasQuery at line 99
protected ArrayRepository queryRepository()

Get the request query repository.

Return Value

ArrayRepository

in HasRetryPolicy at line 23
HasRetryPolicy retry(array|int $times, Closure|int $sleepMilliseconds = 0, callable|null $when = null, bool $throw = true)

Specify the number of times the request should be attempted.

Parameters

array|int $times
Closure|int $sleepMilliseconds
callable|null $when
bool $throw

Return Value

HasRetryPolicy

in HasRetryPolicy at line 37
RetryPolicy|null retryPolicy()

Get the request retry policy.

Return Value

RetryPolicy|null

in HasRetryPolicy at line 45
protected RetryPolicy|null defaultRetryPolicy()

Resolve the default retry policy.

Return Value

RetryPolicy|null

in HasUrlParameters at line 21
array urlParameters()

Get the parameters substituted into URL templates.

Return Value

array

at line 247
PendingRequest withUrlParameters(array $parameters = [])

Specify the URL parameters and invalidate the finalized URI.

Parameters

array $parameters

Return Value

PendingRequest

in Macroable at line 30
static void macro(string $name, callable|object $macro)

Register a custom macro.

Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.

Parameters

string $name
callable|object $macro

Return Value

void

in Macroable at line 44
static void mixin(object $mixin, bool $replace = true)

Mix another object into the class.

Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

in Macroable at line 61
static bool hasMacro(string $name)

Check if macro is registered.

Parameters

string $name

Return Value

bool

in Macroable at line 72
static void flushMacros()

Flush the existing macros.

Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.

Return Value

void

in Macroable at line 83
static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in Macroable at line 108
mixed __call(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

at line 139
__construct(Connector $connector, Request $request)

Create a side-effect-free pending request.

Parameters

Connector $connector
Request $request

at line 185
Connector connector()

Get the connector.

Return Value

Connector

at line 195
Request request()

Get the request.

Return Value

Request

at line 203
Method method()

Get the HTTP method.

Return Value

Method

at line 213
PendingRequest withMethod(Method $method)

Change the HTTP method used by the operation.

Parameters

Method $method

Return Value

PendingRequest

at line 223
string|null url()

Get the absolute URL override.

Return Value

string|null

at line 233
PendingRequest withUrl(string $url)

Replace the connector base URL and request endpoint for this operation.

Parameters

string $url

Return Value

PendingRequest

at line 258
UriInterface uri()

Get the final request URI.

Return Value

UriInterface

at line 284
PendingRequest finalizeUri()

internal  
 

Finalize the request URI after ordinary request middleware.

Return Value

PendingRequest

at line 358
PendingRequest applyAuthentication()

internal  
 

Apply the selected authenticator.

Return Value

PendingRequest

at line 370
protected void setAuthentication(Authenticator $authenticator)

Apply an authenticator while recording its header writes.

Parameters

Authenticator $authenticator

Return Value

void

at line 387
PendingRequest bootPlugins()

internal  
 

Boot the connector and request plugins.

Return Value

PendingRequest

at line 405
PendingRequest mergeMiddleware(MiddlewarePipeline $middleware)

internal  
 

Merge global or request middleware into this operation's own pipeline.

Parameters

MiddlewarePipeline $middleware

Return Value

PendingRequest

at line 417
PendingRequest executeRequestPipeline()

internal  
 

Execute the request middleware pipeline.

Return Value

PendingRequest

at line 427
Response executeResponsePipeline(Response $response)

Execute the response middleware pipeline.

Parameters

Response $response

Return Value

Response

at line 435
void executeFatalPipeline(FatalRequestException $exception)

Execute the fatal exception middleware pipeline.

Parameters

FatalRequestException $exception

Return Value

void

at line 445
PendingRequest prepareBody()

internal  
 

Prepare the request body after ordinary request middleware.

Return Value

PendingRequest

at line 467
StreamInterface|null preparedBody()

internal  
 

Get the prepared request body.

Return Value

StreamInterface|null

at line 505
protected void recordAuthenticationHeaders(array $headers)

Record headers written during authentication, including unchanged values.

Parameters

array $headers

Return Value

void

at line 520
array authenticationHeaderNames()

internal  
 

Get the authentication header names.

Return Value

array

at line 531
PendingRequest setTransportAuthentication(array $authentication)

Set the dedicated transport authentication option.

Parameters

array $authentication

Return Value

PendingRequest

at line 543
array|null transportAuthentication()

Get the dedicated transport authentication option.

Return Value

array|null

at line 553
PendingRequest setCertificate(string $path, string|null $password = null)

Set the client certificate option.

Parameters

string $path
string|null $password

Return Value

PendingRequest

at line 565
array|string|null certificate()

Get the client certificate option.

Return Value

array|string|null

at line 577
PendingRequest observePsrRequest(callable $observer)

internal  
 

Observe the final application-owned PSR request.

Parameters

callable $observer

Return Value

PendingRequest

at line 587
RequestInterface handlePsrRequest(RequestInterface $request)

Apply the connector and request PSR hooks.

Parameters

RequestInterface $request

Return Value

RequestInterface

at line 599
void notifyPsrRequestObservers(RequestInterface $request)

internal  
 

Notify the final PSR request observers.

Parameters

RequestInterface $request

Return Value

void

at line 611
RequestInterface createPsrRequest()

internal  
 

Create the logical PSR request for a short-circuit response.

Return Value

RequestInterface

at line 638
PendingRequest setPsrRequest(RequestInterface $request)

internal  
 

Set the final application-owned PSR request.

Parameters

RequestInterface $request

Return Value

PendingRequest

at line 653
RequestInterface toPsrRequest()

Get the captured PSR request or create a logical snapshot.

Before authoritative capture, the snapshot does not run PSR hooks or observers. It materializes the body from its repository instead of reusing a prepared stream, though caller-owned streams may be shared.

Return Value

RequestInterface

at line 684
bool restoreAttemptBody()

internal  
 

Restore the attempt body before another attempt.

Return Value

bool

at line 709
PendingRequest setFakeResponse(FakeResponse|null $fakeResponse)

Set the fake response.

Parameters

FakeResponse|null $fakeResponse

Return Value

PendingRequest

at line 719
FakeResponse|null fakeResponse()

Get the fake response.

Return Value

FakeResponse|null

at line 734
PendingRequest validateCachingConfiguration()

internal  
 

Validate the request's caching configuration.

Return Value

PendingRequest

at line 751
bool isCacheable()

internal  
 

Determine if this operation is cacheable.

Return Value

bool

at line 766
bool shouldInvalidateCache()

internal  
 

Determine if the matching cache entry should be invalidated.

Return Value

bool

at line 776
DateInterval|DateTimeInterface|int cacheFor()

internal  
 

Get the cache duration.

Return Value

DateInterval|DateTimeInterface|int

at line 787
UnitEnum|string|null cacheStore()

internal  
 

Get the selected cache store.

Return Value

UnitEnum|string|null

at line 803
string|null resolveCacheKey()

internal  
 

Resolve the custom cache key.

Return Value

string|null

at line 812
protected Cacheable|null cacheableResource()

Resolve the request or connector that owns cache duration and storage.

Return Value

Cacheable|null

at line 827
Response createResponse(Response $response, RequestInterface $request)

internal  
 

Create the response selected by this operation.

Parameters

Response $response
RequestInterface $request

Return Value

Response

at line 842
string|null resolveResponseClass(Response $response)

Resolve the custom response class.

Parameters

Response $response

Return Value

string|null

at line 857
protected int|null streamOffset(StreamInterface|null $stream)

Get the current offset of a seekable stream.

Parameters

StreamInterface|null $stream

Return Value

int|null

at line 865
protected string|null multipartContentType()

Resolve the multipart content type unless the caller provided one with a boundary.

Return Value

string|null

at line 887
static void flushState()

Flush all static state.

Return Value

void