Modules

HTTP_Response

Implements: Kohana_HTTP_Response | Kohana_HTTP_Interaction | HTTP_Interaction

Class declared in SYSPATH/classes/http/response.php on line 3.

Constants

  • None

Properties

  • None

Methods

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

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 status( [ integer $code = NULL ] ) (defined in Kohana_HTTP_Response)

Sets or gets the HTTP status from this response.

 // Set the HTTP status to 404 Not Found
 $response = Response::factory()
         ->status(404);

 // Get the current status
 $status = $response->status();

Parameters

  • integer $code = NULL - Status to set to this response

Return Values

  • mixed

Source Code

public function status($code = NULL);

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

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_Interaction)

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_Interaction)

Renders the HTTP_Interaction to a string, producing

  • Protocol
  • Headers
  • Body

Return Values

  • string

Source Code

public function render();