ClientInterface.php 874 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace OAuth\Common\Http\Client;
  3. use OAuth\Common\Http\Uri\UriInterface;
  4. use OAuth\Common\Http\Exception\TokenResponseException;
  5. /**
  6. * Any HTTP clients to be used with the library should implement this interface.
  7. */
  8. interface ClientInterface
  9. {
  10. /**
  11. * Any implementing HTTP providers should send a request to the provided endpoint with the parameters.
  12. * They should return, in string form, the response body and throw an exception on error.
  13. *
  14. * @param UriInterface $endpoint
  15. * @param mixed $requestBody
  16. * @param array $extraHeaders
  17. * @param string $method
  18. *
  19. * @return string
  20. *
  21. * @throws TokenResponseException
  22. */
  23. public function retrieveResponse(
  24. UriInterface $endpoint,
  25. $requestBody,
  26. array $extraHeaders = array(),
  27. $method = 'POST'
  28. );
  29. }