Transport.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Base HTTP transport
  4. *
  5. * @package Requests
  6. * @subpackage Transport
  7. */
  8. /**
  9. * Base HTTP transport
  10. *
  11. * @package Requests
  12. * @subpackage Transport
  13. */
  14. interface Requests_Transport {
  15. /**
  16. * Perform a request
  17. *
  18. * @param string $url URL to request
  19. * @param array $headers Associative array of request headers
  20. * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD
  21. * @param array $options Request options, see {@see Requests::response()} for documentation
  22. * @return string Raw HTTP result
  23. */
  24. public function request($url, $headers = array(), $data = array(), $options = array());
  25. /**
  26. * Send multiple requests simultaneously
  27. *
  28. * @param array $requests Request data (array of 'url', 'headers', 'data', 'options') as per {@see Requests_Transport::request}
  29. * @param array $options Global options, see {@see Requests::response()} for documentation
  30. * @return array Array of Requests_Response objects (may contain Requests_Exception or string responses as well)
  31. */
  32. public function request_multiple($requests, $options);
  33. /**
  34. * Self-test whether the transport can be used
  35. * @return bool
  36. */
  37. public static function test();
  38. }