GuzzleHttpPsr7modify_request

Clone and modify a request with the given changes.

Description

GuzzleHttp\Psr7\modify_request( (RequestInterface) Psr\Http\Message\RequestInterface $request, (array) array $changes ); 

The changes can be one of: - method: (string) Changes the HTTP method. - set_headers: (array) Sets the given headers. - remove_headers: (array) Remove the given headers. - body: (mixed) Sets the given body. - uri: (UriInterface) Set the URI. - query: (string) Set the query string value of the URI. - version: (string) Set the protocol version.

Parameters (2)

0. $request (RequestInterface) => Psr\Http\Message\RequestInterface $request
Request to clone and modify.
1. $changes (array) => array $changes
Changes to apply.

Usage

  1. if ( !function_exists( 'GuzzleHttp\Psr7\modify_request' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'w3-total-cache/lib/Azure/GuzzleHttp/Psr7/functions.php'; 
  3.  
  4. // Request to clone and modify. 
  5. $request = Psr\Http\Message\RequestInterface $request; 
  6.  
  7. // Changes to apply. 
  8. $changes = array(); 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = GuzzleHttp\Psr7\modify_request($request, $changes); 
  12.  

Defined (1)

The function is defined in the following location(s).

/lib/Azure/GuzzleHttp/Psr7/functions.php