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