PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.1
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.1
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / vendor_prefixed / guzzlehttp / guzzle / src / RequestOptions.php

RequestOptions.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.1, at vendor_prefixed/guzzlehttp/guzzle/src/RequestOptions.php

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