~tcuthbert/wordpress/openstack-objectstorage-k8s

« back to all changes in this revision

Viewing changes to vendor/guzzlehttp/guzzle/src/Message/MessageFactoryInterface.php

  • Committer: Thomas Cuthbert
  • Date: 2020-04-23 05:22:45 UTC
  • Revision ID: thomas.cuthbert@canonical.com-20200423052245-1jxao3mw31w435js
[,r=trivial] bionic composer vendor update

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
namespace GuzzleHttp\Message;
 
3
 
 
4
use GuzzleHttp\Url;
 
5
 
 
6
/**
 
7
 * Request and response factory
 
8
 */
 
9
interface MessageFactoryInterface
 
10
{
 
11
    /**
 
12
     * Creates a response
 
13
     *
 
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
 
21
     *
 
22
     * @return ResponseInterface
 
23
     */
 
24
    public function createResponse(
 
25
        $statusCode,
 
26
        array $headers = [],
 
27
        $body = null,
 
28
        array $options = []
 
29
    );
 
30
 
 
31
    /**
 
32
     * Create a new request based on the HTTP method.
 
33
     *
 
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.
 
38
     *
 
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
 
62
     *
 
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
 
66
     *
 
67
     * @return RequestInterface
 
68
     * @link http://docs.guzzlephp.org/en/latest/clients.html#request-options
 
69
     */
 
70
    public function createRequest($method, $url, array $options = []);
 
71
}