PluginProbe
Gmail SMTP / trunk
Gmail SMTP vtrunk
1.2.3.21 1.2.3.20 trunk 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.9 1.2.0 1.2.3.14 1.2.3.15 1.2.3.16 1.2.3.18 1.2.3.5
gmail-smtp / google-api-php-client / vendor / guzzlehttp / guzzle / src / RequestOptions.php

RequestOptions.php in Gmail SMTP trunk, at google-api-php-client/vendor/guzzlehttp/guzzle/src/RequestOptions.php

323 lines 12.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace GuzzleHttp;
4
5 /**
6 * This class contains a list of built-in Guzzle request options.
7 *
8 * @see https://github.com/guzzle/guzzle/blob/7.12/docs/request-options.md
9 */
10 final class RequestOptions
11 {
12 /**
13 * allow_redirects: (bool|array) Controls redirect behavior. Pass false
14 * to disable redirects, pass true to enable redirects, pass an
15 * associative to provide custom redirect settings. Defaults to "false".
16 * This option only works if your handler has the RedirectMiddleware. When
17 * passing an associative array, you can provide the following key value
18 * pairs:
19 *
20 * - max: (int, default=5) maximum number of allowed redirects.
21 * - strict: (bool, default=false) Set to true to use strict redirects
22 * meaning redirect POST requests with POST requests vs. doing what most
23 * browsers do which is redirect POST requests with GET requests
24 * - referer: (bool, default=false) Set to true to enable the Referer
25 * header.
26 * - protocols: (non-empty-array<array-key, string>, default=['http', 'https'])
27 * Allowed redirect protocols. Redirect matching is case-sensitive; use
28 * "http" and "https".
29 * - on_redirect: (callable) PHP callable that is invoked when a redirect
30 * is encountered. The callable is invoked with the request, the redirect
31 * response that was received, and the effective URI. Any return value
32 * from the on_redirect function is ignored.
33 * - track_redirects: (bool, default=false) Track redirected URI and status
34 * history in response headers.
35 */
36 public const ALLOW_REDIRECTS = 'allow_redirects';
37
38 /**
39 * auth: (array{0: string, 1: string, 2?: string|null}|string|false|null)
40 * Pass an array of HTTP authentication parameters to use with the request.
41 * The array must contain the username in index [0], the password in index
42 * [1], and you can optionally provide a built-in authentication type in
43 * index [2]. Pass false or null to disable authentication for a request.
44 * String values are passed through for custom handlers.
45 */
46 public const AUTH = 'auth';
47
48 /**
49 * body: (resource|string|null|int|float|bool|\Psr\Http\Message\StreamInterface|(callable&object)|\Iterator|\Stringable)
50 * Body to send in the request. Callable arrays are arrays, and arrays are
51 * not valid body values in Guzzle.
52 */
53 public const BODY = 'body';
54
55 /**
56 * cert: (string|array{0: string, 1?: string|null}) Set to a string to
57 * specify the path to a client certificate file. PEM is the default
58 * certificate format. If a password is required, set cert to an array
59 * containing the certificate path in the first array element followed by
60 * the certificate password in the second array element. A null password is
61 * treated the same as omitting it. Use cert_type to specify another
62 * supported certificate format.
63 */
64 public const CERT = 'cert';
65
66 /**
67 * cert_type: (string) Specify the SSL client certificate file type.
68 */
69 public const CERT_TYPE = 'cert_type';
70
71 /**
72 * cookies: (false|GuzzleHttp\Cookie\CookieJarInterface, default=false)
73 * Specifies whether or not cookies are used in a request or what cookie
74 * jar to use or what cookies to send. This option only works if your
75 * handler has the `cookie` middleware. Valid values are `false` and
76 * an instance of {@see Cookie\CookieJarInterface}.
77 */
78 public const COOKIES = 'cookies';
79
80 /**
81 * connect_timeout: (int|float, default=0) Number of seconds to wait while
82 * trying to connect to a server. Use 0 to wait 300 seconds (the default
83 * behavior).
84 */
85 public const CONNECT_TIMEOUT = 'connect_timeout';
86
87 /**
88 * crypto_method: (int) A value describing the minimum TLS protocol
89 * version to use.
90 *
91 * This setting must be set to one of the
92 * ``STREAM_CRYPTO_METHOD_TLS*_CLIENT`` constants. PHP 7.4 or higher is
93 * required in order to use TLS 1.3, and cURL 7.34.0 or higher is required
94 * in order to specify a crypto method, with cURL 7.52.0 or higher being
95 * required to use TLS 1.3.
96 */
97 public const CRYPTO_METHOD = 'crypto_method';
98
99 /**
100 * curl: (array) Raw cURL options to apply when using a built-in cURL handler.
101 */
102 public const CURL = 'curl';
103
104 /**
105 * debug: (bool|resource) Set to true or set to a PHP stream returned by
106 * fopen() enable debug output with the HTTP handler used to send a
107 * request.
108 */
109 public const DEBUG = 'debug';
110
111 /**
112 * decode_content: (bool|string, default=true) Specify whether or not
113 * Content-Encoding responses (gzip, deflate, etc.) are automatically
114 * decoded.
115 */
116 public const DECODE_CONTENT = 'decode_content';
117
118 /**
119 * delay: (int|float) The amount of time to delay before sending in
120 * milliseconds.
121 */
122 public const DELAY = 'delay';
123
124 /**
125 * expect: (bool|integer) Controls the behavior of the
126 * "Expect: 100-Continue" header.
127 *
128 * Set to `true` to enable the "Expect: 100-Continue" header for all
129 * requests that sends a body. Set to `false` to disable the
130 * "Expect: 100-Continue" header for all requests. Set to a number so that
131 * the size of the payload must be greater than the number in order to send
132 * the Expect header. Setting to a number will send the Expect header for
133 * all requests in which the size of the payload cannot be determined or
134 * where the body is not rewindable.
135 *
136 * By default, Guzzle will add the "Expect: 100-Continue" header when the
137 * size of the body of a request is greater than 1 MB and a request is
138 * using HTTP/1.1.
139 */
140 public const EXPECT = 'expect';
141
142 /**
143 * form_params: (array<array-key, string|int|float|bool|null|array>)
144 * Associative array of form field names to scalar, null, or nested array
145 * values. Sets the Content-Type header to application/x-www-form-urlencoded
146 * when no Content-Type header is already present.
147 */
148 public const FORM_PARAMS = 'form_params';
149
150 /**
151 * headers: (array<array-key, string|non-empty-array<array-key, string>>|null)
152 * Associative array of HTTP headers. Each value MUST be a string or non-empty
153 * array of strings.
154 */
155 public const HEADERS = 'headers';
156
157 /**
158 * http_errors: (bool, default=true) Set to false to disable exceptions
159 * when a non- successful HTTP response is received. By default,
160 * exceptions will be thrown for 4xx and 5xx responses. This option only
161 * works if your handler has the `httpErrors` middleware.
162 */
163 public const HTTP_ERRORS = 'http_errors';
164
165 /**
166 * idn_conversion: (bool|int|null, default=false) A combination of IDNA_*
167 * constants for PHP's idn_to_ascii() function. Set to false or null to
168 * disable IDN support, or to true to use the default configuration
169 * (IDNA_DEFAULT constant).
170 */
171 public const IDN_CONVERSION = 'idn_conversion';
172
173 /**
174 * json: (mixed) Adds JSON data to a request. The provided value is JSON
175 * encoded and a Content-Type header of application/json will be added to
176 * the request if no Content-Type header is already present.
177 */
178 public const JSON = 'json';
179
180 /**
181 * multipart: (array) Array of part arrays, each containing a required
182 * "name" key mapping to the string or integer form field name, a required
183 * "contents" key mapping to any non-array value accepted by PSR-7
184 * Utils::streamFor() or a nested array of field values, an optional
185 * "headers" array of string custom header values, and an optional
186 * "filename" key mapping to a string to send as the filename in the part.
187 * "headers" and "filename" cannot be used when "contents" is an array.
188 */
189 public const MULTIPART = 'multipart';
190
191 /**
192 * on_headers: (callable) A callable that is invoked when the HTTP headers
193 * of the response have been received but the body has not yet begun to
194 * download.
195 */
196 public const ON_HEADERS = 'on_headers';
197
198 /**
199 * on_stats: (callable) allows you to get access to transfer statistics of
200 * a request and access the lower level transfer details of the handler
201 * associated with your client. ``on_stats`` is a callable that is invoked
202 * when a handler has finished sending a request. The callback is invoked
203 * with transfer statistics about the request, the response received, or
204 * the error encountered. Included in the data is the total amount of time
205 * taken to send the request.
206 */
207 public const ON_STATS = 'on_stats';
208
209 /**
210 * progress: (callable) Defines a function to invoke when transfer
211 * progress is made. The function accepts the following positional
212 * arguments: the total number of bytes expected to be downloaded, the
213 * number of bytes downloaded so far, the number of bytes expected to be
214 * uploaded, the number of bytes uploaded so far.
215 */
216 public const PROGRESS = 'progress';
217
218 /**
219 * protocols: (non-empty-array<array-key, string>, default=['http', 'https'])
220 * Allowed URI schemes. Built-in handlers accept only the case-sensitive
221 * values "http" and "https".
222 */
223 public const PROTOCOLS = 'protocols';
224
225 /**
226 * proxy: (string|array) Pass a string to specify an HTTP proxy, or an
227 * array to specify different proxies for different protocols (where the
228 * key is the protocol and the value is a proxy string or null). Provide a
229 * "no" key as a comma-delimited string, array of strings, or null to
230 * specify hosts or host-and-port pairs that should not be proxied.
231 */
232 public const PROXY = 'proxy';
233
234 /**
235 * query: (array<array-key, mixed>|string) Associative array of query string
236 * values to add to the request. This option uses PHP's http_build_query()
237 * to create the string representation. Pass a string value if you need
238 * more control than what this method provides
239 */
240 public const QUERY = 'query';
241
242 /**
243 * sink: (resource|string|\Psr\Http\Message\StreamInterface) Where the data
244 * of the response is written to. Defaults to a PHP temp stream. Providing
245 * a string will write data to a file by the given name.
246 */
247 public const SINK = 'sink';
248
249 /**
250 * synchronous: (bool) Set to true to inform HTTP handlers that you intend
251 * on waiting on the response. This can be useful for optimizations. Note
252 * that a promise is still returned if you are using one of the async
253 * client methods.
254 */
255 public const SYNCHRONOUS = 'synchronous';
256
257 /**
258 * ssl_key: (array{0: string, 1?: string|null}|string) Specify the path to
259 * a private SSL key file. PEM is the default private key format. If a
260 * password is required, set ssl_key to an array containing the key path in
261 * the first array element followed by the key password in the second
262 * element. A null password is treated the same as omitting it. Use
263 * ssl_key_type to specify another supported key format.
264 */
265 public const SSL_KEY = 'ssl_key';
266
267 /**
268 * ssl_key_type: (string) Specify the SSL private key file type.
269 */
270 public const SSL_KEY_TYPE = 'ssl_key_type';
271
272 /**
273 * stream: (bool) Set to true to attempt to stream a response rather than
274 * download it all up-front.
275 */
276 public const STREAM = 'stream';
277
278 /**
279 * stream_context: (array) PHP stream context options to merge into the
280 * context used by the built-in stream handler.
281 */
282 public const STREAM_CONTEXT = 'stream_context';
283
284 /**
285 * verify: (bool|string, default=true) Describes the SSL certificate
286 * verification behavior of a request. Set to true to enable SSL
287 * certificate verification using the system CA bundle when available
288 * (the default). Set to false to disable certificate verification (this
289 * is insecure!). Set to a string to provide the path to a CA bundle on
290 * disk to enable verification using a custom certificate.
291 */
292 public const VERIFY = 'verify';
293
294 /**
295 * timeout: (int|float, default=0) Number describing the timeout of the
296 * request in seconds. Use 0 to wait indefinitely (the default behavior).
297 */
298 public const TIMEOUT = 'timeout';
299
300 /**
301 * read_timeout: (int|float, default=default_socket_timeout ini setting)
302 * Number describing the body read timeout, for stream requests.
303 */
304 public const READ_TIMEOUT = 'read_timeout';
305
306 /**
307 * retries: (int) Current retry count used by the retry middleware.
308 */
309 public const RETRIES = 'retries';
310
311 /**
312 * version: (string|int|float) Specifies the HTTP protocol version to attempt
313 * to use.
314 */
315 public const VERSION = 'version';
316
317 /**
318 * force_ip_resolve: (string) Set to "v4" to force IPv4 resolution or "v6"
319 * for IPv6 resolution when supported by the handler.
320 */
321 public const FORCE_IP_RESOLVE = 'force_ip_resolve';
322 }
323