Browse: Home /

Namespace: HttpClient

CurlClient::resetCurlHandle()

Method: Resets the curl handle. If the handle is not already initialized, or if persistent connections are disabled, the handle is reinitialized instead.

CurlClient::setRequestStatusCallback()

Method: Sets a callback that is called after each request. The callback will receive the following parameters:

  1. string $rbody The response body
  2. integer $rcode The response status code
  3. \Stripe\Util\CaseInsensitiveArray $rheaders The response headers
  4. integer $errno The curl error number
  5. string|null $message The curl error message
  6. boolean $shouldRetry Whether the request will be retried
  7. integer $numRetries The number of the retry attempt

.

CurlClient::useHeadersToDetermineWriteCallback()

Method: Curl permits sending \CURLOPT_HEADERFUNCTION, which is called with lines from the header and \CURLOPT_WRITEFUNCTION, which is called with bytes from the body. You usually want to handle the body differently depending on what was in the header.

CurlClient::executeStreamingRequestWithRetries()

Method: Like `executeRequestWithRetries` except: 1. Does not buffer the body of a successful (status code < 300) response into memory -- instead, calls the caller-provided $readBodyChunk with each chunk of incoming data.