ResponseInterface.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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;
  9. /**
  10. * PHP PhantomJs
  11. *
  12. * @author Jon Wenmoth <contact@jonnyw.me>
  13. */
  14. interface ResponseInterface
  15. {
  16. /**
  17. * Get HTTP headers array
  18. *
  19. * @return array
  20. */
  21. public function getHeaders();
  22. /**
  23. * Get HTTP header value for code
  24. *
  25. * @praam string $$code
  26. * @return mixed
  27. */
  28. public function getHeader($code);
  29. /**
  30. * Get response status code
  31. *
  32. * @return int|null
  33. */
  34. public function getStatus();
  35. /**
  36. * Get page content from respone
  37. *
  38. * @return string
  39. */
  40. public function getContent();
  41. /**
  42. * Get content type header
  43. *
  44. * @return string
  45. */
  46. public function getContentType();
  47. /**
  48. * Get request URL
  49. *
  50. * @return string
  51. */
  52. public function getUrl();
  53. /**
  54. * Get redirect URL (if redirected)
  55. *
  56. * @return string
  57. */
  58. public function getRedirectUrl();
  59. /**
  60. * Is response a redirect
  61. * - Checks status codes
  62. *
  63. * @return boolean
  64. */
  65. public function isRedirect();
  66. /**
  67. * Get time string
  68. *
  69. * @return string
  70. */
  71. public function getTime();
  72. }