GuzzleHttpRequestOptions

This class contains a list of built-in Guzzle request options.

Defined (1)

The class is defined in the following location(s).

/lib/Azure/GuzzleHttp/RequestOptions.php  
  1. final class RequestOptions 
  2. /** 
  3. * allow_redirects: (bool|array) Controls redirect behavior. Pass false 
  4. * to disable redirects, pass true to enable redirects, pass an 
  5. * associative to provide custom redirect settings. Defaults to "false". 
  6. * This option only works if your handler has the RedirectMiddleware. When 
  7. * passing an associative array, you can provide the following key value 
  8. * pairs: 
  9. * - max: (int, default=5) maximum number of allowed redirects. 
  10. * - strict: (bool, default=false) Set to true to use strict redirects 
  11. * meaning redirect POST requests with POST requests vs. doing what most 
  12. * browsers do which is redirect POST requests with GET requests 
  13. * - referer: (bool, default=true) Set to false to disable the Referer 
  14. * header. 
  15. * - protocols: (array, default=['http', 'https']) Allowed redirect 
  16. * protocols. 
  17. * - on_redirect: (callable) PHP callable that is invoked when a redirect 
  18. * is encountered. The callable is invoked with the request, the redirect 
  19. * response that was received, and the effective URI. Any return value 
  20. * from the on_redirect function is ignored. 
  21. */ 
  22. const ALLOW_REDIRECTS = 'allow_redirects'; 
  23.  
  24. /** 
  25. * auth: (array) Pass an array of HTTP authentication parameters to use 
  26. * with the request. The array must contain the username in index [0],  
  27. * the password in index [1], and you can optionally provide a built-in 
  28. * authentication type in index [2]. Pass null to disable authentication 
  29. * for a request. 
  30. */ 
  31. const AUTH = 'auth'; 
  32.  
  33. /** 
  34. * body: (string|null|callable|iterator|object) Body to send in the 
  35. * request. 
  36. */ 
  37. const BODY = 'body'; 
  38.  
  39. /** 
  40. * cert: (string|array) Set to a string to specify the path to a file 
  41. * containing a PEM formatted SSL client side certificate. If a password 
  42. * is required, then set cert to an array containing the path to the PEM 
  43. * file in the first array element followed by the certificate password 
  44. * in the second array element. 
  45. */ 
  46. const CERT = 'cert'; 
  47.  
  48. /** 
  49. * cookies: (bool|GuzzleHttp\Cookie\CookieJarInterface, default=false) 
  50. * Specifies whether or not cookies are used in a request or what cookie 
  51. * jar to use or what cookies to send. This option only works if your 
  52. * handler has the `cookie` middleware. Valid values are `false` and 
  53. * an instance of {@see GuzzleHttp\Cookie\CookieJarInterface}. 
  54. */ 
  55. const COOKIES = 'cookies'; 
  56.  
  57. /** 
  58. * connect_timeout: (float, default=0) Float describing the number of 
  59. * seconds to wait while trying to connect to a server. Use 0 to wait 
  60. * indefinitely (the default behavior). 
  61. */ 
  62. const CONNECT_TIMEOUT = 'connect_timeout'; 
  63.  
  64. /** 
  65. * debug: (bool|resource) Set to true or set to a PHP stream returned by 
  66. * fopen() enable debug output with the HTTP handler used to send a 
  67. * request. 
  68. */ 
  69. const DEBUG = 'debug'; 
  70.  
  71. /** 
  72. * decode_content: (bool, default=true) Specify whether or not 
  73. * Content-Encoding responses (gzip, deflate, etc.) are automatically 
  74. * decoded. 
  75. */ 
  76. const DECODE_CONTENT = 'decode_content'; 
  77.  
  78. /** 
  79. * delay: (int) The amount of time to delay before sending in milliseconds. 
  80. */ 
  81. const DELAY = 'delay'; 
  82.  
  83. /** 
  84. * expect: (bool|integer) Controls the behavior of the 
  85. * "Expect: 100-Continue" header. 
  86. * Set to `true` to enable the "Expect: 100-Continue" header for all 
  87. * requests that sends a body. Set to `false` to disable the 
  88. * "Expect: 100-Continue" header for all requests. Set to a number so that 
  89. * the size of the payload must be greater than the number in order to send 
  90. * the Expect header. Setting to a number will send the Expect header for 
  91. * all requests in which the size of the payload cannot be determined or 
  92. * where the body is not rewindable. 
  93. * By default, Guzzle will add the "Expect: 100-Continue" header when the 
  94. * size of the body of a request is greater than 1 MB and a request is 
  95. * using HTTP/1.1. 
  96. */ 
  97. const EXPECT = 'expect'; 
  98.  
  99. /** 
  100. * form_params: (array) Associative array of form field names to values 
  101. * where each value is a string or array of strings. Sets the Content-Type 
  102. * header to application/x-www-form-urlencoded when no Content-Type header 
  103. * is already present. 
  104. */ 
  105. const FORM_PARAMS = 'form_params'; 
  106.  
  107. /** 
  108. * headers: (array) Associative array of HTTP headers. Each value MUST be 
  109. * a string or array of strings. 
  110. */ 
  111. const HEADERS = 'headers'; 
  112.  
  113. /** 
  114. * http_errors: (bool, default=true) Set to false to disable exceptions 
  115. * when a non- successful HTTP response is received. By default,  
  116. * exceptions will be thrown for 4xx and 5xx responses. This option only 
  117. * works if your handler has the `httpErrors` middleware. 
  118. */ 
  119. const HTTP_ERRORS = 'http_errors'; 
  120.  
  121. /** 
  122. * json: (mixed) Adds JSON data to a request. The provided value is JSON 
  123. * encoded and a Content-Type header of application/json will be added to 
  124. * the request if no Content-Type header is already present. 
  125. */ 
  126. const JSON = 'json'; 
  127.  
  128. /** 
  129. * multipart: (array) Array of associative arrays, each containing a 
  130. * required "name" key mapping to the form field, name, a required 
  131. * "contents" key mapping to a StreamInterface|resource|string, an 
  132. * optional "headers" associative array of custom headers, and an 
  133. * optional "filename" key mapping to a string to send as the filename in 
  134. * the part. If no "filename" key is present, then no "filename" attribute 
  135. * will be added to the part. 
  136. */ 
  137. const MULTIPART = 'multipart'; 
  138.  
  139. /** 
  140. * on_headers: (callable) A callable that is invoked when the HTTP headers 
  141. * of the response have been received but the body has not yet begun to 
  142. * download. 
  143. */ 
  144. const ON_HEADERS = 'on_headers'; 
  145.  
  146. /** 
  147. * on_stats: (callable) allows you to get access to transfer statistics of 
  148. * a request and access the lower level transfer details of the handler 
  149. * associated with your client. ``on_stats`` is a callable that is invoked 
  150. * when a handler has finished sending a request. The callback is invoked 
  151. * with transfer statistics about the request, the response received, or 
  152. * the error encountered. Included in the data is the total amount of time 
  153. * taken to send the request. 
  154. */ 
  155. const ON_STATS = 'on_stats'; 
  156.  
  157. /** 
  158. * progress: (callable) Defines a function to invoke when transfer 
  159. * progress is made. The function accepts the following positional 
  160. * arguments: the total number of bytes expected to be downloaded, the 
  161. * number of bytes downloaded so far, the number of bytes expected to be 
  162. * uploaded, the number of bytes uploaded so far. 
  163. */ 
  164. const PROGRESS = 'progress'; 
  165.  
  166. /** 
  167. * proxy: (string|array) Pass a string to specify an HTTP proxy, or an 
  168. * array to specify different proxies for different protocols (where the 
  169. * key is the protocol and the value is a proxy string). 
  170. */ 
  171. const PROXY = 'proxy'; 
  172.  
  173. /** 
  174. * query: (array|string) Associative array of query string values to add 
  175. * to the request. This option uses PHP's http_build_query() to create 
  176. * the string representation. Pass a string value if you need more 
  177. * control than what this method provides 
  178. */ 
  179. const QUERY = 'query'; 
  180.  
  181. /** 
  182. * sink: (resource|string|StreamInterface) Where the data of the 
  183. * response is written to. Defaults to a PHP temp stream. Providing a 
  184. * string will write data to a file by the given name. 
  185. */ 
  186. const SINK = 'sink'; 
  187.  
  188. /** 
  189. * synchronous: (bool) Set to true to inform HTTP handlers that you intend 
  190. * on waiting on the response. This can be useful for optimizations. Note 
  191. * that a promise is still returned if you are using one of the async 
  192. * client methods. 
  193. */ 
  194. const SYNCHRONOUS = 'synchronous'; 
  195.  
  196. /** 
  197. * ssl_key: (array|string) Specify the path to a file containing a private 
  198. * SSL key in PEM format. If a password is required, then set to an array 
  199. * containing the path to the SSL key in the first array element followed 
  200. * by the password required for the certificate in the second element. 
  201. */ 
  202. const SSL_KEY = 'ssl_key'; 
  203.  
  204. /** 
  205. * stream: Set to true to attempt to stream a response rather than 
  206. * download it all up-front. 
  207. */ 
  208. const STREAM = 'stream'; 
  209.  
  210. /** 
  211. * verify: (bool|string, default=true) Describes the SSL certificate 
  212. * verification behavior of a request. Set to true to enable SSL 
  213. * certificate verification using the system CA bundle when available 
  214. * (the default). Set to false to disable certificate verification (this 
  215. * is insecure!). Set to a string to provide the path to a CA bundle on 
  216. * disk to enable verification using a custom certificate. 
  217. */ 
  218. const VERIFY = 'verify'; 
  219.  
  220. /** 
  221. * timeout: (float, default=0) Float describing the timeout of the 
  222. * request in seconds. Use 0 to wait indefinitely (the default behavior). 
  223. */ 
  224. const TIMEOUT = 'timeout'; 
  225.  
  226. /** 
  227. * version: (float) Specifies the HTTP protocol version to attempt to use. 
  228. */ 
  229. const VERSION = 'version';