|
| applyOptions (RequestInterface $request, array $options=array(), $flags=self::OPTIONS_NONE) |
|
| create ($method, $url, $headers=null, $body=null, array $options=array()) |
|
| fromMessage ($message) |
|
| fromParts ( $method, array $urlParts, $headers=null, $body=null, $protocol='HTTP', $protocolVersion='1.1') |
|
Request factory used to create HTTP requests
Definition at line 12 of file RequestFactoryInterface.php.
◆ applyOptions()
Guzzle\Http\Message\RequestFactoryInterface::applyOptions |
( |
RequestInterface |
$request, |
|
|
array |
$options = array() , |
|
|
|
$flags = self::OPTIONS_NONE |
|
) |
| |
Apply an associative array of options to the request
- Parameters
-
RequestInterface | $request | Request to update |
array | $options | Options to use with the request. Available options are: "headers": Associative array of headers "query": Associative array of query string values to add to the request "body": Body of a request, including an EntityBody, string, or array when sending POST requests. "auth": Array of HTTP authentication parameters to use with the request. The array must contain the username in index [0], the password in index [2], and can optionally contain the authentication type in index [3]. The authentication types are: "Basic", "Digest", "NTLM", "Any" (defaults to "Basic"). "cookies": Associative array of cookies "allow_redirects": Set to false to disable redirects "save_to": String, fopen resource, or EntityBody object used to store the body of the response "events": Associative array mapping event names to a closure or array of (priority, closure) "plugins": Array of plugins to add to the request "exceptions": Set to false to disable throwing exceptions on an HTTP level error (e.g. 404, 500, etc) "params": Set custom request data parameters on a request. (Note: these are not query string parameters) "timeout": Float describing the timeout of the request in seconds "connect_timeout": Float describing the number of seconds to wait while trying to connect. Use 0 to wait indefinitely. "verify": Set to true to enable SSL cert validation (the default), false to disable, or supply the path to a CA bundle to enable verification using a custom certificate. "cert": Set to a string to specify the path to a file containing a PEM formatted certificate. If a password is required, then set an array containing the path to the PEM file followed by the the password required for the certificate. "ssl_key": Specify the path to a file containing a private SSL key in PEM format. If a password is required, then set an array containing the path to the SSL key followed by the password required for the certificate. "proxy": Specify an HTTP proxy (e.g. "http://username:password@192.168.16.1:10") "debug": Set to true to display all data sent over the wire |
int | $flags | Bitwise flags to apply when applying the options to the request. Defaults to no special options. 1 (OPTIONS_AS_DEFAULTS): When specified, options will only update a request when the value does not already exist on the request. This is only supported by "query" and "headers". Other bitwise options may be added in the future. |
Implemented in Guzzle\Http\Message\RequestFactory.
◆ create()
Guzzle\Http\Message\RequestFactoryInterface::create |
( |
|
$method, |
|
|
|
$url, |
|
|
|
$headers = null , |
|
|
|
$body = null , |
|
|
array |
$options = array() |
|
) |
| |
Create a new request based on the HTTP method
- Parameters
-
string | $method | HTTP method (GET, POST, PUT, PATCH, HEAD, DELETE, ...) |
string | Url | $url | HTTP URL to connect to |
array | Collection | $headers | HTTP headers |
string | resource | array | EntityBodyInterface | $body | Body to send in the request |
array | $options | Array of options to apply to the request |
- Returns
- RequestInterface
Implemented in Guzzle\Http\Message\RequestFactory.
◆ fromMessage()
Guzzle\Http\Message\RequestFactoryInterface::fromMessage |
( |
|
$message | ) |
|
◆ fromParts()
Guzzle\Http\Message\RequestFactoryInterface::fromParts |
( |
|
$method, |
|
|
array |
$urlParts, |
|
|
|
$headers = null , |
|
|
|
$body = null , |
|
|
|
$protocol = 'HTTP' , |
|
|
|
$protocolVersion = '1.1' |
|
) |
| |
Create a request from URL parts as returned from parse_url()
- Parameters
-
string | $method | HTTP method (GET, POST, PUT, HEAD, DELETE, etc) |
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 ?
|
array | Collection | $headers | HTTP headers |
string | resource | array | EntityBodyInterface | $body | Body to send in the request |
string | $protocol | Protocol (HTTP, SPYDY, etc) |
string | $protocolVersion | 1.0, 1.1, etc |
- Returns
- RequestInterface
Implemented in Guzzle\Http\Message\RequestFactory.
◆ OPTIONS_AS_DEFAULTS
const Guzzle\Http\Message\RequestFactoryInterface::OPTIONS_AS_DEFAULTS = 1 |
◆ OPTIONS_NONE
const Guzzle\Http\Message\RequestFactoryInterface::OPTIONS_NONE = 0 |
The documentation for this interface was generated from the following file: