Class RequestFactory
-
Guzzle\Http\Message\RequestFactory
implements
Guzzle\Http\Message\RequestFactoryInterface
Methods summary
public static
Guzzle\Http\Message\RequestFactory
|
#
getInstance( )
Get a cached instance of the default request factory
Get a cached instance of the default request factory
Returns
|
public
Guzzle\Http\Message\RequestInterface
|
#
fromMessage( string $message )
Create a new request based on an HTTP message
Create a new request based on an HTTP message
Parameters
- $message
string $message HTTP message as a string
Returns
Implementation of
|
public
Guzzle\Http\Message\RequestInterface
|
#
fromParts( string $method, array $urlParts, array|Guzzle\Common\Collection $headers = null, string|resource|array|EntityBodyInterface $body = null, string $protocol = 'HTTP', string $protocolVersion = '1.1' )
Create a request from URL parts as returned from parse_url()
Create a request from URL parts as returned from parse_url()
Parameters
- $method
string $method HTTP method (GET, POST, PUT, HEAD, DELETE, etc)
- $urlParts
array $urlParts URL parts containing the same keys as parse_url() - scheme: e.g. http
- host: e.g. www.guzzle-project.com
- port: e.g. 80 - user: e.g. michael - pass: e.g. rocks - path: e.g. / OR
/index.html - query: after the question mark ?
- $headers
array|Guzzle\Common\Collection $headers HTTP headers
- $body
string|resource|array|EntityBodyInterface $body Body to send in the request
- $protocol
string $protocol Protocol (HTTP, SPYDY, etc)
- $protocolVersion
string $protocolVersion 1.0, 1.1, etc
Returns
Implementation of
|
public
Guzzle\Http\Message\RequestInterface
|
#
create( string $method, string|Guzzle\Http\Url $url, array|Guzzle\Common\Collection $headers = null, string|resource|array|EntityBodyInterface $body = null )
Create a new request based on the HTTP method
Create a new request based on the HTTP method
Parameters
- $method
string $method HTTP method (GET, POST, PUT, PATCH, HEAD, DELETE, ...)
- $url
string|Guzzle\Http\Url $url HTTP URL to connect to
- $headers
array|Guzzle\Common\Collection $headers HTTP headers
- $body
string|resource|array|EntityBodyInterface $body Body to send in the request
Returns
Implementation of
|
public
Guzzle\Http\Message\RequestInterface
|
#
cloneRequestWithMethod( Guzzle\Http\Message\RequestInterface $request, string $method )
Clone a request while changing the method. Emulates the behavior of Guzzle\Http\Message\Request::clone, but can change the HTTP method.
Clone a request while changing the method. Emulates the behavior of Guzzle\Http\Message\Request::clone, but can change the HTTP method.
Parameters
Returns
|
Properties summary
protected static
Guzzle\Http\Message\RequestFactory
|
$instance
|
|
#
Singleton instance of the default request factory
Singleton instance of the default request factory
|
protected
string
|
$requestClass
|
'Guzzle\\Http\\Message\\Request' |
#
Class to instantiate for requests with no body
Class to instantiate for requests with no body
|
protected
string
|
$entityEnclosingRequestClass
|
'Guzzle\\Http\\Message\\EntityEnclosingRequest' |
#
Class to instantiate for requests with a body
Class to instantiate for requests with a body
|