Request.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php defined('SYSPATH') OR die('No direct script access.');
  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) 2008-2012 Kohana Team
  12. * @license http://kohanaphp.com/license
  13. */
  14. interface Kohana_HTTP_Request extends HTTP_Message {
  15. // HTTP Methods
  16. const GET = 'GET';
  17. const POST = 'POST';
  18. const PUT = 'PUT';
  19. const DELETE = 'DELETE';
  20. const HEAD = 'HEAD';
  21. const OPTIONS = 'OPTIONS';
  22. const TRACE = 'TRACE';
  23. const CONNECT = 'CONNECT';
  24. /**
  25. * Gets or sets the HTTP method. Usually GET, POST, PUT or DELETE in
  26. * traditional CRUD applications.
  27. *
  28. * @param string $method Method to use for this request
  29. * @return mixed
  30. */
  31. public function method($method = NULL);
  32. /**
  33. * Gets the URI of this request, optionally allows setting
  34. * of [Route] specific parameters during the URI generation.
  35. * If no parameters are passed, the request will use the
  36. * default values defined in the Route.
  37. *
  38. * @param array $params Optional parameters to include in uri generation
  39. * @return string
  40. */
  41. public function uri();
  42. /**
  43. * Gets or sets HTTP query string.
  44. *
  45. * @param mixed $key Key or key value pairs to set
  46. * @param string $value Value to set to a key
  47. * @return mixed
  48. */
  49. public function query($key = NULL, $value = NULL);
  50. /**
  51. * Gets or sets HTTP POST parameters to the request.
  52. *
  53. * @param mixed $key Key or key value pairs to set
  54. * @param string $value Value to set to a key
  55. * @return mixed
  56. */
  57. public function post($key = NULL, $value = NULL);
  58. }