Class HTTP_Request

HTTP_Request

extends Kohana_HTTP_Request
extends Kohana_HTTP_Message
extends HTTP_Message

Implements: Kohana_HTTP_Request | Kohana_HTTP_Message | HTTP_Message

A HTTP Request specific interface that adds the methods required by HTTP requests. Over and above Kohana_HTTP_Interaction, this interface provides method, uri, get and post methods.

package
Kohana
category
HTTP
author
Kohana Team
since
3.1.0
copyright
(c) Kohana Team
license
https://koseven.ga/LICENSE.md


Constants

GET

string(3) "GET"

POST

string(4) "POST"

PATCH

string(5) "PATCH"

PUT

string(3) "PUT"

DELETE

string(6) "DELETE"

HEAD

string(4) "HEAD"

OPTIONS

string(7) "OPTIONS"

TRACE

string(5) "TRACE"

CONNECT

string(7) "CONNECT"

Methods

abstract public method([ string $method = NULL ] ) (defined in Kohana_HTTP_Request)

Gets or sets the HTTP method. Usually GET, POST, PUT or DELETE in traditional CRUD applications.

Parameters

  • string $method = NULL - Method to use for this request

Return Values

  • mixed

Source Code

public function method($method = NULL);

abstract public post([ mixed $key = NULL , string $value = NULL ] ) (defined in Kohana_HTTP_Request)

Gets or sets HTTP POST parameters to the request.

Parameters

  • mixed $key = NULL - Key or key value pairs to set
  • string $value = NULL - Value to set to a key

Return Values

  • mixed

Source Code

public function post($key = NULL, $value = NULL);

abstract public query([ mixed $key = NULL , string $value = NULL ] ) (defined in Kohana_HTTP_Request)

Gets or sets HTTP query string.

Parameters

  • mixed $key = NULL - Key or key value pairs to set
  • string $value = NULL - Value to set to a key

Return Values

  • mixed

Source Code

public function query($key = NULL, $value = NULL);

abstract public uri() (defined in Kohana_HTTP_Request)

Gets the URI of this request, optionally allows setting of Route specific parameters during the URI generation. If no parameters are passed, the request will use the default values defined in the Route.

Return Values

  • string

Source Code

public function uri();

abstract public body([ string $content = NULL ] ) (defined in Kohana_HTTP_Message)

Gets or sets the HTTP body to the request or response. The body is included after the header, separated by a single empty new line.

Parameters

  • string $content = NULL - Content to set to the object

Return Values

  • string
  • void

Source Code

public function body($content = NULL);

abstract public headers([ mixed $key = NULL , string $value = NULL ] ) (defined in Kohana_HTTP_Message)

Gets or sets HTTP headers to the request or response. All headers are included immediately after the HTTP protocol definition during transmission. This method provides a simple array or key/value interface to the headers.

Parameters

  • mixed $key = NULL - Key or array of key/value pairs to set
  • string $value = NULL - Value to set to the supplied key

Return Values

  • mixed

Source Code

public function headers($key = NULL, $value = NULL);

abstract public protocol([ string $protocol = NULL ] ) (defined in Kohana_HTTP_Message)

Gets or sets the HTTP protocol. The standard protocol to use is HTTP/1.1.

Parameters

  • string $protocol = NULL - Protocol to set to the request/response

Return Values

  • mixed

Source Code

public function protocol($protocol = NULL);

abstract public render() (defined in Kohana_HTTP_Message)

Renders the HTTP_Interaction to a string, producing

  • Protocol
  • Headers
  • Body

Return Values

  • string

Source Code

public function render();

Do you want to contribute to Koseven?

We need YOUR help!

This project is open source. What does this mean? YOU can help:
  • Found a bug? Report it on Github
  • Need a feature? Add it Here
  • Want to help? Join the Forum
Go to Github