Request.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /**
  3. * A HTTP Request specific interface that adds the methods required
  4. * by HTTP requests. Over and above [Kohana_HTTP_Interaction], this
  5. * interface provides method, uri, get and post methods.
  6. *
  7. * @package Kohana
  8. * @category HTTP
  9. * @author Kohana Team
  10. * @since 3.1.0
  11. * @copyright (c) Kohana Team
  12. * @license https://koseven.ga/LICENSE.md
  13. */
  14. interface Kohana_HTTP_Request extends HTTP_Message {
  15. // HTTP Methods
  16. const GET = 'GET';
  17. const POST = 'POST';
  18. const PATCH = 'PATCH';
  19. const PUT = 'PUT';
  20. const DELETE = 'DELETE';
  21. const HEAD = 'HEAD';
  22. const OPTIONS = 'OPTIONS';
  23. const TRACE = 'TRACE';
  24. const CONNECT = 'CONNECT';
  25. /**
  26. * Gets or sets the HTTP method. Usually GET, POST, PUT or DELETE in
  27. * traditional CRUD applications.
  28. *
  29. * @param string $method Method to use for this request
  30. * @return mixed
  31. */
  32. public function method($method = NULL);
  33. /**
  34. * Gets the URI of this request, optionally allows setting
  35. * of [Route] specific parameters during the URI generation.
  36. * If no parameters are passed, the request will use the
  37. * default values defined in the Route.
  38. *
  39. * @param array $params Optional parameters to include in uri generation
  40. * @return string
  41. */
  42. public function uri();
  43. /**
  44. * Gets or sets HTTP query string.
  45. *
  46. * @param mixed $key Key or key value pairs to set
  47. * @param string $value Value to set to a key
  48. * @return mixed
  49. */
  50. public function query($key = NULL, $value = NULL);
  51. /**
  52. * Gets or sets HTTP POST parameters to the request.
  53. *
  54. * @param mixed $key Key or key value pairs to set
  55. * @param string $value Value to set to a key
  56. * @return mixed
  57. */
  58. public function post($key = NULL, $value = NULL);
  59. }