You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
922 B

  1. <?php
  2. namespace p3k\HTTP;
  3. interface Transport {
  4. /*
  5. Return an array with the following keys:
  6. * code - integer, the HTTP response code that was returned
  7. * header - string, the HTTP headers returned
  8. * body - string, the body of the HTTP response, or false/omit for a HEAD request
  9. * error - string, an error string. see below for the enumerated list.
  10. * error_description - string,
  11. * url - string, the final URL retrieved after following any redirects
  12. * debug - string, the full HTTP response
  13. Error Strings:
  14. * dns_error
  15. * connect_error
  16. * timeout
  17. * ssl_error
  18. * ssl_cert_error
  19. * ssl_unsupported_cipher
  20. * too_many_redirects
  21. * unknown
  22. */
  23. public function get($url, $headers);
  24. public function post($url, $body, $headers=[]);
  25. public function head($url);
  26. public function set_timeout($timeout);
  27. public function set_max_redirects($max_redirects);
  28. }