HttpResponse.php 570 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace common\util;
  3. class HttpResponse
  4. {
  5. private $body;
  6. private $status;
  7. public function getBody()
  8. {
  9. return $this->body;
  10. }
  11. public function setBody($body)
  12. {
  13. $this->body = $body;
  14. }
  15. public function getStatus()
  16. {
  17. return $this->status;
  18. }
  19. public function setStatus($status)
  20. {
  21. $this->status = $status;
  22. }
  23. public function isSuccess()
  24. {
  25. if(200 <= $this->status && 300 > $this->status)
  26. {
  27. return true;
  28. }
  29. return false;
  30. }
  31. }