2
namespace GuzzleHttp\Message;
7
* Request and response factory
9
interface MessageFactoryInterface
14
* @param string $statusCode HTTP status code
15
* @param array $headers Response headers
16
* @param mixed $body Response body
17
* @param array $options Response options
18
* - protocol_version: HTTP protocol version
19
* - header_factory: Factory used to create headers
20
* - And any other options used by a concrete message implementation
22
* @return ResponseInterface
24
public function createResponse(
32
* Create a new request based on the HTTP method.
34
* This method accepts an associative array of request options. Below is a
35
* brief description of each parameter. See
36
* http://docs.guzzlephp.org/en/latest/clients.html#request-options for a much more
37
* in-depth description of each parameter.
39
* - headers: Associative array of headers to add to the request
40
* - body: string|resource|array|StreamInterface request body to send
41
* - json: mixed Uploads JSON encoded data using an application/json Content-Type header.
42
* - query: Associative array of query string values to add to the request
43
* - auth: array|string HTTP auth settings (user, pass[, type="basic"])
44
* - version: The HTTP protocol version to use with the request
45
* - cookies: true|false|CookieJarInterface To enable or disable cookies
46
* - allow_redirects: true|false|array Controls HTTP redirects
47
* - save_to: string|resource|StreamInterface Where the response is saved
48
* - events: Associative array of event names to callables or arrays
49
* - subscribers: Array of event subscribers to add to the request
50
* - exceptions: Specifies whether or not exceptions are thrown for HTTP protocol errors
51
* - timeout: Timeout of the request in seconds. Use 0 to wait indefinitely
52
* - connect_timeout: Number of seconds to wait while trying to connect. (0 to wait indefinitely)
53
* - verify: SSL validation. True/False or the path to a PEM file
54
* - cert: Path a SSL cert or array of (path, pwd)
55
* - ssl_key: Path to a private SSL key or array of (path, pwd)
56
* - proxy: Specify an HTTP proxy or hash of protocols to proxies
57
* - debug: Set to true or a resource to view handler specific debug info
58
* - stream: Set to true to stream a response body rather than download it all up front
59
* - expect: true/false/integer Controls the "Expect: 100-Continue" header
60
* - config: Associative array of request config collection options
61
* - decode_content: true/false/string to control decoding content-encoding responses
63
* @param string $method HTTP method (GET, POST, PUT, etc.)
64
* @param string|Url $url HTTP URL to connect to
65
* @param array $options Array of options to apply to the request
67
* @return RequestInterface
68
* @link http://docs.guzzlephp.org/en/latest/clients.html#request-options
70
public function createRequest($method, $url, array $options = []);