ResponseInterface.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. /*
  3. * This file is part of the php-phantomjs.
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. */
  8. namespace JonnyW\PhantomJs\Message;
  9. /**
  10. * PHP PhantomJs
  11. *
  12. * @author Jon Wenmoth <contact@jonnyw.me>
  13. */
  14. interface ResponseInterface
  15. {
  16. /**
  17. * Set response data
  18. *
  19. * @return JonnyW\PhantomJs\Message\ResponseInterface
  20. */
  21. public function setData(array $data);
  22. /**
  23. * Get HTTP headers array
  24. *
  25. * @return array
  26. */
  27. public function getHeaders();
  28. /**
  29. * Get HTTP header value for code
  30. *
  31. * @praam string $$code
  32. * @return mixed
  33. */
  34. public function getHeader($code);
  35. /**
  36. * Get response status code
  37. *
  38. * @return int|null
  39. */
  40. public function getStatus();
  41. /**
  42. * Get page content from respone
  43. *
  44. * @return string
  45. */
  46. public function getContent();
  47. /**
  48. * Get content type header
  49. *
  50. * @return string
  51. */
  52. public function getContentType();
  53. /**
  54. * Get request URL
  55. *
  56. * @return string
  57. */
  58. public function getUrl();
  59. /**
  60. * Get redirect URL (if redirected)
  61. *
  62. * @return string
  63. */
  64. public function getRedirectUrl();
  65. /**
  66. * Is response a redirect
  67. * - Checks status codes
  68. *
  69. * @return boolean
  70. */
  71. public function isRedirect();
  72. /**
  73. * Get time string
  74. *
  75. * @return string
  76. */
  77. public function getTime();
  78. }