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::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.

CurlClient::shouldRetry()

Method: Checks if an error is a problem that we should retry on. This includes both socket errors that may represent an intermittent problem and some special HTTP statuses.

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

.