StreamingClientInterface.php 1.1 KB

1234567891011121314151617181920212223
  1. <?php
  2. namespace Stripe\HttpClient;
  3. interface StreamingClientInterface
  4. {
  5. /**
  6. * @param 'delete'|'get'|'post' $method The HTTP method being used
  7. * @param string $absUrl The URL being requested, including domain and protocol
  8. * @param array $headers Headers to be used in the request (full strings, not KV pairs)
  9. * @param array $params KV pairs for parameters. Can be nested for arrays and hashes
  10. * @param bool $hasFile Whether or not $params references a file (via an @ prefix or
  11. * CURLFile)
  12. * @param callable $readBodyChunkCallable a function that will be called with chunks of bytes from the body if the request is successful
  13. *
  14. * @throws \Stripe\Exception\ApiConnectionException
  15. * @throws \Stripe\Exception\UnexpectedValueException
  16. *
  17. * @return array an array whose first element is raw request body, second
  18. * element is HTTP status code and third array of HTTP headers
  19. */
  20. public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunkCallable);
  21. }