HttpClientInterface.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. namespace Temando\Shipping\Webservice;
  6. /**
  7. * Wrapper around Zend HTTP Client
  8. *
  9. * @package Temando\Shipping\Webservice
  10. * @author Christoph Aßmann <christoph.assmann@netresearch.de>
  11. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  12. * @link http://www.temando.com/
  13. */
  14. interface HttpClientInterface
  15. {
  16. const METHOD_GET = 'GET';
  17. const METHOD_POST = 'POST';
  18. const METHOD_PUT = 'PUT';
  19. const METHOD_PATCH = 'PATCH';
  20. const METHOD_DELETE = 'DELETE';
  21. /**
  22. * Set headers.
  23. *
  24. * @see \Zend\Http\Client::setHeaders()
  25. * @see \Zend_Http_Client::setHeaders()
  26. *
  27. * @param string[] $headers
  28. * @return \Zend\Http\Client|\Zend_Http_Client
  29. */
  30. public function setHeaders(array $headers);
  31. /**
  32. * @see \Zend\Http\Client::setUri()
  33. * @see \Zend_Http_Client::setUri()
  34. *
  35. * @param string $uri
  36. * @return \Zend\Http\Client|\Zend_Http_Client
  37. */
  38. public function setUri($uri);
  39. /**
  40. * @see \Zend\Http\Client::setOptions()
  41. * @see \Zend_Http_Client::setConfig()
  42. *
  43. * @param string[] $options
  44. * @return \Zend\Http\Client|\Zend_Http_Client
  45. */
  46. public function setOptions(array $options);
  47. /**
  48. * @see \Zend\Http\Client::setRawBody()
  49. * @see \Zend_Http_Client::setRawData()
  50. *
  51. * @param string $rawBody
  52. * @return \Zend\Http\Client|\Zend_Http_Client
  53. */
  54. public function setRawBody($rawBody);
  55. /**
  56. * @see \Zend\Http\Client::setParameterGet()
  57. * @see \Zend_Http_Client::setParameterGet()
  58. *
  59. * @param string[] $queryParams
  60. * @return \Zend\Http\Client|\Zend_Http_Client
  61. */
  62. public function setParameterGet($queryParams);
  63. /**
  64. * Perform the request and return plain response body.
  65. *
  66. * @see \Zend\Http\Client::send()
  67. * @see \Zend_Http_Client::request()
  68. *
  69. * @param string $method
  70. * @return string The response body
  71. * @throws \Temando\Shipping\Webservice\Exception\HttpRequestException
  72. * @throws \Temando\Shipping\Webservice\Exception\HttpResponseException
  73. */
  74. public function send($method);
  75. }