Documentation

Client extends AbstractHttp
in package
implements ClientInterface

HTTP client class

Tags
category

Pop

author

Nick Sagona, III nick@popphp.org

copyright

Copyright (c) 2009-2026 Nick Sagona, III

license

https://www.popphp.org/license New BSD License

version
6.0.0

Table of Contents

Interfaces

ClientInterface

Properties

$auth  : Auth|null
HTTP auth object
$handler  : HandlerInterface|null
Request handler
$middleware  : array<string|int, mixed>
Registered middleware, in registration order (first-registered = outermost)
$multiHandler  : CurlMulti|null
Request multi-handler
$options  : array<string|int, mixed>
Client options
$request  : AbstractRequest|null
Request
$response  : AbstractResponse|null
Response

Methods

__call()  : Response|Promise|array<string|int, mixed>|string
Magic method to send requests by the method name, i.e. $client->get('http://localhost/');
__callStatic()  : Response|Promise|array<string|int, mixed>|string
Magic method to send requests by the static method name, i.e. Client::get('http://localhost/');
__construct()  : mixed
Instantiate the client object
__toString()  : string
To string magic method to render the client request to a raw string
addData()  : Client
Add data
addFile()  : Client
Add file
addHeader()  : Client
Add header
addHeaders()  : Client
Add headers
addMiddleware()  : Client
Add a middleware to the pipeline. A plain callable is wrapped in CallableMiddleware automatically. Registration order is wrap order: the first-registered middleware is outermost.
addOption()  : Client
Add an option
addOptions()  : Client
Add options
addQuery()  : Client
Add query
createMulti()  : CurlMulti
Factory to create a multi-handler object
dispatch()  : Response|array<string|int, mixed>|string
Perform the actual synchronous dispatch, always - unlike send(), this does NOT redirect to sendAsync() when the 'async' option is set. Promise::wait()/ resolve() call this (not send()) to perform the real request: since a Promise wraps a Client whose 'async' option is still true for the lifetime of that Client, calling send() from inside wait()/resolve() would re-enter the async branch above and return a brand-new Promise instead of ever dispatching.
dispatchRequest()  : Response
Perform the actual handler dispatch for the given request - the terminal handler at the center of the middleware pipeline. If $request is a Client\Request, it's re-pointed as $this->request first, so any middleware-applied modifications (e.g. an injected header) are reflected in what's actually sent. A foreign (non-Client\Request) PSR-7 request is converted first, reusing the same conversion sendRequest() uses.
fromCurlCommand()  : Client
Method to convert Curl CLI command to a client object
getAuth()  : Auth|null
Get auth
getBody()  : Body|null
Get request body
getBodyContent()  : string|null
Get request body content
getBodyContentLength()  : int
Get request body content length
getData()  : mixed
Get data
getFile()  : string|null
Get file
getFiles()  : array<string|int, mixed>|null
Get files
getHandler()  : HandlerInterface|null
Get handler
getHeader()  : mixed
Get header
getHeaders()  : mixed
Get headers
getMethod()  : string|null
Get method
getMiddleware()  : array<string|int, mixed>
Get the registered middleware, in registration order
getMultiHandler()  : CurlMulti
Get multi-handler
getOption()  : mixed
Get options
getOptions()  : array<string|int, mixed>
Get options
getQuery()  : mixed
Get query
getRequest()  : Request
Get the request
getResponse()  : Response
Get the response
getType()  : mixed
Get type
hasAuth()  : bool
Has auth
hasBody()  : bool
Has request body
hasData()  : bool
Has data
hasFile()  : bool
Has file
hasFiles()  : bool
Has files
hasHandler()  : bool
Has handler
hasHeader()  : bool
Has header
hasHeaders()  : bool
Has headers
hasMethod()  : bool
Has method
hasMiddleware()  : bool
Has any middleware registered
hasMultiHandler()  : bool
Has multi-handler
hasOption()  : bool
Has option
hasOptions()  : bool
Has options
hasQuery()  : bool
Has query
hasRequest()  : bool
Has request
hasResponse()  : bool
Get the response
hasType()  : bool
Has type
isAccepted()  : bool|null
Determine if the response is 202 accepted
isBadGateway()  : bool|null
Determine if the response is a 502 Bad Gateway
isBadRequest()  : bool|null
Determine if the response is a 400 Bad Request
isClientError()  : bool|null
Determine if the response is a client error
isComplete()  : bool
Determine if the response is complete
isConflict()  : bool|null
Determine if the response is a 409 Conflict
isContinue()  : bool|null
Determine if the response is a continue
isCreated()  : bool|null
Determine if the response is 201 created
isError()  : bool|null
Determine if the response is an error
isForbidden()  : bool|null
Determine if the response is a 403 Forbidden
isFound()  : bool|null
Determine if the response is a 302 Found
isInternalServerError()  : bool|null
Determine if the response is a 500 Internal Server Error
isLengthRequired()  : bool|null
Determine if the response is a 411 Length Required
isMethodNotAllowed()  : bool|null
Determine if the response is a 405 Method Not Allowed
isMovedPermanently()  : bool|null
Determine if the response is a 301 Moved Permanently
isNoContent()  : bool|null
Determine if the response is 204 No Content
isNotAcceptable()  : bool|null
Determine if the response is a 406 Not Acceptable
isNotFound()  : bool|null
Determine if the response is a 404 Not Found
isOk()  : bool|null
Determine if the response is 200 OK
isRedirect()  : bool|null
Determine if the response is a redirect
isRequestTimeout()  : bool|null
Determine if the response is a 408 Request Timeout
isServerError()  : bool|null
Determine if the response is a server error
isServiceUnavailable()  : bool|null
Determine if the response is a 503 Service Unavailable
isSuccess()  : bool|null
Determine if the response is a success
isTooManyRequests()  : bool|null
Determine if the response is a 429 Too Many Requests
isUnauthorized()  : bool|null
Determine if the response is a 401 Unauthorized
isUnprocessableEntity()  : bool|null
Determine if the response is a 422 Unprocessable Entity
isUnsupportedMediaType()  : bool|null
Determine if the response is a 415 Unsupported Media Type
prepare()  : Client
Prepare the client request
removeAllData()  : Client
Remove all data
removeAllHeaders()  : Client
Remove all headers
removeAllQuery()  : Client
Remove all query data
removeBody()  : Client
Remove the body
removeData()  : Client
Remove data
removeFile()  : Client
Remove file
removeFiles()  : Client
Remove all files
removeHeader()  : Client
Remove header
removeOption()  : Client
Remove option
removeOptions()  : Client
Remove options
removeQuery()  : Client
Remove query
removeType()  : Client
Remove type
render()  : string
Method to render the request as a string
reset()  : static
Method to reset the client
send()  : Response|Promise|array<string|int, mixed>|string
Send the client request
sendAsync()  : Promise
Method to send the request asynchronously
sendRequest()  : ResponseInterface
Send a PSR-7 request and return a PSR-7 response, per PSR-18
setAuth()  : Client
Set auth
setBody()  : Client
Set request body
setBodyFromFile()  : Client
Set request body from file
setData()  : Client
Set data
setFiles()  : Client
Set files
setHandler()  : Client
Set handler
setHeaders()  : Client
Set headers (clear out any existing headers)
setMethod()  : Client
Set method
setMultiHandler()  : Client
Set multi-handler
setOptions()  : Client
Set options
setQuery()  : Client
Set query
setRequest()  : Client
Set the request object
setResponse()  : AbstractHttp
Set the response
setType()  : Client
Set type
toCurlCommand()  : string
Method to convert client object to a Curl command for the CLI
convertToClientRequest()  : Request
Convert a foreign (non-Client\Request) PSR-7 RequestInterface into a Client\Request. A Client\Request passed in is returned as-is. Shared by sendRequest() (the PSR-18 entry point) and dispatchRequest() (so a middleware that substitutes a foreign PSR-7 request is honored rather than silently dropped).
processMiddleware()  : Response
Run the request through the middleware pipeline (if any), terminating in dispatchRequest(). Shared by dispatch() and sendRequest() so middleware behaves identically regardless of entry point.
request()  : Request
Get the client's request, materializing an empty one if none exists yet - every data-touching setter goes through this, so there is exactly one place a Client\Request gets created on demand instead of the old options-array-vs-request dual bookkeeping.
syncRequestFromOptions()  : void
Push request-shaped options ('type', 'headers', 'query', 'data', 'files') onto the client's request, if one exists. Options are configuration that seeds the request the moment both are available - they are not a second, parallel data store - so this is the one place that seeding happens, called any time the request or the options change.

Properties

$auth

HTTP auth object

protected Auth|null $auth = null

$middleware

Registered middleware, in registration order (first-registered = outermost)

protected array<string|int, mixed> $middleware = []

$multiHandler

Request multi-handler

protected CurlMulti|null $multiHandler = null

$options

Client options

protected array<string|int, mixed> $options = []

Methods

__call()

Magic method to send requests by the method name, i.e. $client->get('http://localhost/');

public __call(string $methodName, array<string|int, mixed> $arguments) : Response|Promise|array<string|int, mixed>|string
Parameters
$methodName : string
$arguments : array<string|int, mixed>
Tags
throws
Exception|Exception|Exception
Return values
Response|Promise|array<string|int, mixed>|string

__callStatic()

Magic method to send requests by the static method name, i.e. Client::get('http://localhost/');

public static __callStatic(string $methodName, array<string|int, mixed> $arguments) : Response|Promise|array<string|int, mixed>|string
Parameters
$methodName : string
$arguments : array<string|int, mixed>
Tags
throws
Exception|Exception|Exception
Return values
Response|Promise|array<string|int, mixed>|string

__construct()

Instantiate the client object

public __construct() : mixed

Optional parameters are

  • Request URI string
  • Client request instance
  • Client response instance
  • Client handler instance
  • Auth instance
  • Options array

__toString()

To string magic method to render the client request to a raw string

public __toString() : string
Return values
string

addData()

Add data

public addData(string $name, mixed $value) : Client
Parameters
$name : string
$value : mixed
Return values
Client

addFile()

Add file

public addFile(string $file[, string|null $name = null ]) : Client
Parameters
$file : string
$name : string|null = null
Tags
throws
Exception
Return values
Client

addHeader()

Add header

public addHeader(Header|string|int $header[, mixed $value = null ]) : Client
Parameters
$header : Header|string|int
$value : mixed = null
Return values
Client

addHeaders()

Add headers

public addHeaders(array<string|int, mixed> $headers) : Client
Parameters
$headers : array<string|int, mixed>
Return values
Client

addMiddleware()

Add a middleware to the pipeline. A plain callable is wrapped in CallableMiddleware automatically. Registration order is wrap order: the first-registered middleware is outermost.

public addMiddleware(MiddlewareInterface|callable $middleware) : Client
Parameters
$middleware : MiddlewareInterface|callable
Return values
Client

addOption()

Add an option

public addOption(string $name, mixed $value) : Client
Parameters
$name : string
$value : mixed
Return values
Client

addOptions()

Add options

public addOptions(array<string|int, mixed> $options) : Client
Parameters
$options : array<string|int, mixed>
Return values
Client

addQuery()

Add query

public addQuery(string $name, mixed $value) : Client
Parameters
$name : string
$value : mixed
Return values
Client

createMulti()

Factory to create a multi-handler object

public static createMulti(array<string|int, mixed> $requests[, CurlMulti $multiHandler = new ClientHandlerCurlMulti() ]) : CurlMulti
Parameters
$requests : array<string|int, mixed>
$multiHandler : CurlMulti = new ClientHandlerCurlMulti()
Return values
CurlMulti

dispatch()

Perform the actual synchronous dispatch, always - unlike send(), this does NOT redirect to sendAsync() when the 'async' option is set. Promise::wait()/ resolve() call this (not send()) to perform the real request: since a Promise wraps a Client whose 'async' option is still true for the lifetime of that Client, calling send() from inside wait()/resolve() would re-enter the async branch above and return a brand-new Promise instead of ever dispatching.

public dispatch([string|null $uri = null ][, string|null $method = null ]) : Response|array<string|int, mixed>|string
Parameters
$uri : string|null = null
$method : string|null = null
Tags
throws
Exception|Exception|Exception
Return values
Response|array<string|int, mixed>|string

dispatchRequest()

Perform the actual handler dispatch for the given request - the terminal handler at the center of the middleware pipeline. If $request is a Client\Request, it's re-pointed as $this->request first, so any middleware-applied modifications (e.g. an injected header) are reflected in what's actually sent. A foreign (non-Client\Request) PSR-7 request is converted first, reusing the same conversion sendRequest() uses.

public dispatchRequest(RequestInterface $request) : Response

Note: this is public (so a terminal callable passed into Pipeline::process() can reach it), but it assumes prepare() has already run - it does not create a handler itself, and depends on $this->handler already being set.

Parameters
$request : RequestInterface
Tags
throws
Exception|Exception|Exception
Return values
Response

fromCurlCommand()

Method to convert Curl CLI command to a client object

public static fromCurlCommand(string $command) : Client
Parameters
$command : string
Tags
throws
Exception
Return values
Client

getAuth()

Get auth

public getAuth() : Auth|null
Return values
Auth|null

getBody()

Get request body

public getBody() : Body|null
Return values
Body|null

getBodyContent()

Get request body content

public getBodyContent() : string|null
Return values
string|null

getBodyContentLength()

Get request body content length

public getBodyContentLength([bool $mb = false ]) : int
Parameters
$mb : bool = false
Return values
int

getData()

Get data

public getData([string|null $key = null ]) : mixed
Parameters
$key : string|null = null

getFile()

Get file

public getFile(string $key) : string|null
Parameters
$key : string
Return values
string|null

getFiles()

Get files

public getFiles() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

getHeader()

Get header

public getHeader(string $name) : mixed
Parameters
$name : string

getHeaders()

Get headers

public getHeaders() : mixed

getMethod()

Get method

public getMethod() : string|null
Return values
string|null

getMiddleware()

Get the registered middleware, in registration order

public getMiddleware() : array<string|int, mixed>
Return values
array<string|int, mixed>

getOption()

Get options

public getOption(string $name) : mixed
Parameters
$name : string

getOptions()

Get options

public getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getQuery()

Get query

public getQuery([string|null $key = null ]) : mixed
Parameters
$key : string|null = null

getType()

Get type

public getType() : mixed

hasAuth()

Has auth

public hasAuth() : bool
Return values
bool

hasBody()

Has request body

public hasBody() : bool
Return values
bool

hasData()

Has data

public hasData([string|null $key = null ]) : bool
Parameters
$key : string|null = null
Return values
bool

hasFile()

Has file

public hasFile(string $key) : bool
Parameters
$key : string
Return values
bool

hasFiles()

Has files

public hasFiles() : bool
Return values
bool

hasHandler()

Has handler

public hasHandler() : bool
Return values
bool

hasHeader()

Has header

public hasHeader(string $name) : bool
Parameters
$name : string
Return values
bool

hasHeaders()

Has headers

public hasHeaders() : bool
Return values
bool

hasMethod()

Has method

public hasMethod() : bool
Return values
bool

hasMiddleware()

Has any middleware registered

public hasMiddleware() : bool
Return values
bool

hasMultiHandler()

Has multi-handler

public hasMultiHandler() : bool
Return values
bool

hasOption()

Has option

public hasOption(string $name) : bool
Parameters
$name : string
Return values
bool

hasOptions()

Has options

public hasOptions() : bool
Return values
bool

hasQuery()

Has query

public hasQuery([string|null $key = null ]) : bool
Parameters
$key : string|null = null
Return values
bool

hasRequest()

Has request

public hasRequest() : bool
Return values
bool

hasResponse()

Get the response

public hasResponse() : bool
Return values
bool

hasType()

Has type

public hasType() : bool
Return values
bool

isAccepted()

Determine if the response is 202 accepted

public isAccepted() : bool|null
Return values
bool|null

isBadGateway()

Determine if the response is a 502 Bad Gateway

public isBadGateway() : bool|null
Return values
bool|null

isBadRequest()

Determine if the response is a 400 Bad Request

public isBadRequest() : bool|null
Return values
bool|null

isClientError()

Determine if the response is a client error

public isClientError() : bool|null
Return values
bool|null

isComplete()

Determine if the response is complete

public isComplete() : bool
Return values
bool

isConflict()

Determine if the response is a 409 Conflict

public isConflict() : bool|null
Return values
bool|null

isContinue()

Determine if the response is a continue

public isContinue() : bool|null
Return values
bool|null

isCreated()

Determine if the response is 201 created

public isCreated() : bool|null
Return values
bool|null

isError()

Determine if the response is an error

public isError() : bool|null
Return values
bool|null

isForbidden()

Determine if the response is a 403 Forbidden

public isForbidden() : bool|null
Return values
bool|null

isFound()

Determine if the response is a 302 Found

public isFound() : bool|null
Return values
bool|null

isInternalServerError()

Determine if the response is a 500 Internal Server Error

public isInternalServerError() : bool|null
Return values
bool|null

isLengthRequired()

Determine if the response is a 411 Length Required

public isLengthRequired() : bool|null
Return values
bool|null

isMethodNotAllowed()

Determine if the response is a 405 Method Not Allowed

public isMethodNotAllowed() : bool|null
Return values
bool|null

isMovedPermanently()

Determine if the response is a 301 Moved Permanently

public isMovedPermanently() : bool|null
Return values
bool|null

isNoContent()

Determine if the response is 204 No Content

public isNoContent() : bool|null
Return values
bool|null

isNotAcceptable()

Determine if the response is a 406 Not Acceptable

public isNotAcceptable() : bool|null
Return values
bool|null

isNotFound()

Determine if the response is a 404 Not Found

public isNotFound() : bool|null
Return values
bool|null

isOk()

Determine if the response is 200 OK

public isOk() : bool|null
Return values
bool|null

isRedirect()

Determine if the response is a redirect

public isRedirect() : bool|null
Return values
bool|null

isRequestTimeout()

Determine if the response is a 408 Request Timeout

public isRequestTimeout() : bool|null
Return values
bool|null

isServerError()

Determine if the response is a server error

public isServerError() : bool|null
Return values
bool|null

isServiceUnavailable()

Determine if the response is a 503 Service Unavailable

public isServiceUnavailable() : bool|null
Return values
bool|null

isSuccess()

Determine if the response is a success

public isSuccess() : bool|null
Return values
bool|null

isTooManyRequests()

Determine if the response is a 429 Too Many Requests

public isTooManyRequests() : bool|null
Return values
bool|null

isUnauthorized()

Determine if the response is a 401 Unauthorized

public isUnauthorized() : bool|null
Return values
bool|null

isUnprocessableEntity()

Determine if the response is a 422 Unprocessable Entity

public isUnprocessableEntity() : bool|null
Return values
bool|null

isUnsupportedMediaType()

Determine if the response is a 415 Unsupported Media Type

public isUnsupportedMediaType() : bool|null
Return values
bool|null

prepare()

Prepare the client request

public prepare([string|null $uri = null ][, string|null $method = null ]) : Client
Parameters
$uri : string|null = null
$method : string|null = null
Tags
throws
Exception|Exception
Return values
Client

removeAllHeaders()

Remove all headers

public removeAllHeaders() : Client
Return values
Client

removeAllQuery()

Remove all query data

public removeAllQuery() : Client
Return values
Client

removeData()

Remove data

public removeData(string $key) : Client
Parameters
$key : string
Return values
Client

removeFile()

Remove file

public removeFile(string $key) : Client
Parameters
$key : string
Return values
Client

removeHeader()

Remove header

public removeHeader(string $name) : Client
Parameters
$name : string
Return values
Client

removeOption()

Remove option

public removeOption(string $name) : Client
Parameters
$name : string
Return values
Client

removeQuery()

Remove query

public removeQuery(string $key) : Client
Parameters
$key : string
Return values
Client

render()

Method to render the request as a string

public render() : string
Return values
string

reset()

Method to reset the client

public reset([bool $data = true ][, bool $headers = false ][, bool $clear = false ]) : static
Parameters
$data : bool = true
$headers : bool = false
$clear : bool = false
Return values
static

send()

Send the client request

public send([string|null $uri = null ][, string|null $method = null ]) : Response|Promise|array<string|int, mixed>|string
Parameters
$uri : string|null = null
$method : string|null = null
Tags
throws
Exception|Exception|Exception
Return values
Response|Promise|array<string|int, mixed>|string

sendAsync()

Method to send the request asynchronously

public sendAsync() : Promise
Return values
Promise

sendRequest()

Send a PSR-7 request and return a PSR-7 response, per PSR-18

public sendRequest(RequestInterface $request) : ResponseInterface
Parameters
$request : RequestInterface
Tags
throws
Exception|Exception|RequestException|Exception
Return values
ResponseInterface

setBodyFromFile()

Set request body from file

public setBodyFromFile(string $file) : Client
Parameters
$file : string
Tags
throws
Exception
Return values
Client

setData()

Set data

public setData(array<string|int, mixed> $data) : Client
Parameters
$data : array<string|int, mixed>
Return values
Client

setFiles()

Set files

public setFiles(array<string|int, mixed>|string $files[, bool $multipart = true ]) : Client
Parameters
$files : array<string|int, mixed>|string
$multipart : bool = true
Tags
throws
Exception
Return values
Client

setHeaders()

Set headers (clear out any existing headers)

public setHeaders(array<string|int, mixed> $headers) : Client
Parameters
$headers : array<string|int, mixed>
Return values
Client

setMethod()

Set method

public setMethod(string $method) : Client
Parameters
$method : string
Return values
Client

setOptions()

Set options

public setOptions(array<string|int, mixed> $options) : Client

Supported options

  • 'base_uri'
  • 'method'
  • 'headers'
  • 'user_agent'
  • 'query' (can only be encoded query string on the URI)
  • 'data' (can be any request data)
  • 'files'
  • 'type'
  • 'auto'
  • 'async'
  • 'verify_peer'
  • 'allow_self_signed'
  • 'no_content_length'
  • 'raw_data'
  • 'force_custom_method' (Curl only - forces CURLOPT_CUSTOMREQUEST)
Parameters
$options : array<string|int, mixed>
Return values
Client

setQuery()

Set query

public setQuery(array<string|int, mixed> $query) : Client
Parameters
$query : array<string|int, mixed>
Return values
Client

setRequest()

Set the request object

public setRequest(AbstractRequest $request) : Client

Overrides AbstractHttp::setRequest() so that any options already set on this client (via the constructor or setOptions()/addOption()) get synced onto a request that arrives via a direct setRequest() call - not just one materialized internally by prepare(). Without this, options set before an explicit setRequest() call were silently dropped, since syncRequestFromOptions() is a no-op until a request exists.

Parameters
$request : AbstractRequest
Return values
Client

setType()

Set type

public setType(string $type[, bool $addHeader = true ]) : Client
Parameters
$type : string
$addHeader : bool = true
Return values
Client

toCurlCommand()

Method to convert client object to a Curl command for the CLI

public toCurlCommand() : string
Tags
throws
Exception|Exception
Return values
string

convertToClientRequest()

Convert a foreign (non-Client\Request) PSR-7 RequestInterface into a Client\Request. A Client\Request passed in is returned as-is. Shared by sendRequest() (the PSR-18 entry point) and dispatchRequest() (so a middleware that substitutes a foreign PSR-7 request is honored rather than silently dropped).

protected convertToClientRequest(RequestInterface $request) : Request
Parameters
$request : RequestInterface
Tags
throws
Exception
Return values
Request

processMiddleware()

Run the request through the middleware pipeline (if any), terminating in dispatchRequest(). Shared by dispatch() and sendRequest() so middleware behaves identically regardless of entry point.

protected processMiddleware(RequestInterface $request) : Response

MiddlewareInterface::process() is typed to the broader PSR-7 ResponseInterface (see that interface's docblock), but this method's return type is narrowed to Client\Response, since that's the concrete type Client's internals require. If a middleware short-circuits with some other ResponseInterface implementation, that mismatch is caught below and re-thrown as a clear Client\Exception rather than surfacing as a raw TypeError.

Parameters
$request : RequestInterface
Tags
throws
Exception|Exception|Exception
Return values
Response

request()

Get the client's request, materializing an empty one if none exists yet - every data-touching setter goes through this, so there is exactly one place a Client\Request gets created on demand instead of the old options-array-vs-request dual bookkeeping.

protected request() : Request
Return values
Request

syncRequestFromOptions()

Push request-shaped options ('type', 'headers', 'query', 'data', 'files') onto the client's request, if one exists. Options are configuration that seeds the request the moment both are available - they are not a second, parallel data store - so this is the one place that seeding happens, called any time the request or the options change.

protected syncRequestFromOptions() : void

'query' and 'data' are merged onto the request key-by-key (addQuery()/addData()), not replaced wholesale (setQuery()/setData()) - this method can run again later (e.g. from a later addOption() call for an unrelated key), and a wholesale replace would silently wipe out any data/query values added directly in between via addData()/addQuery() or a prior sync. 'headers' and 'files' are naturally merge-safe already (addHeaders()/addData() key on name), and 'type' is guarded to apply only once (first request type wins).


        
On this page

Search results