Request.php 708 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace Qiniu\Http;
  3. final class Request
  4. {
  5. /**
  6. * @var string
  7. */
  8. public $url;
  9. /**
  10. * @var array<string, string>
  11. */
  12. public $headers;
  13. /**
  14. * @var mixed|null
  15. */
  16. public $body;
  17. /**
  18. * @var string
  19. */
  20. public $method;
  21. /**
  22. * @var RequestOptions
  23. */
  24. public $opt;
  25. public function __construct($method, $url, array $headers = array(), $body = null, $opt = null)
  26. {
  27. $this->method = strtoupper($method);
  28. $this->url = $url;
  29. $this->headers = $headers;
  30. $this->body = $body;
  31. if ($opt === null) {
  32. $opt = new RequestOptions();
  33. }
  34. $this->opt = $opt;
  35. }
  36. }