Class Merb::Request
In: lib/merb-core/dispatch/request.rb
lib/merb-core/dispatch/dispatcher.rb
Parent: Object

Methods

Included Modules

Merb::ControllerExceptions

Constants

METHODS = %w{get post put delete head options}

Attributes

env  [RW]  :api: private
route  [RW]  :api: private
route_params  [R]  :api: private
start  [R] 

Public Class methods

Memoizes the new request object into env so we can memoize things into ivars in the request

Parameters

env<Hash>:A rack environment
*args<Array>:Other arguments passed to the superclass

Returns

Merb::Request:The new Merb::Request

:api: public

Initialize the request object.

Parameters

http_request<~params:~[], ~body:IO>:An object like an HTTP Request.

:api: private

Public Instance methods

Notes

Processes the return value of a deferred router block and returns the current route params for the current request evaluation

:api: private

Returns

String:The accepted response types. Defaults to "*/*".

:api: private

Returns

String:The accepted character sets.

:api: public

Returns

String:The accepted encodings.

:api: private

Returns

String:The accepted language.

:api: public

ajax?()

Alias for xml_http_request?

Returns

String:HTTP cache control.

:api: public

Returns

String:The HTTP connection.

:api: private

Returns

Fixnum:The request content length.

:api: public

Returns

String:The request content type.

:api: private

Returns the controller object for initialization and dispatching the request.

Returns

Class:The controller class matching the routed request,
  e.g. Posts.

:api: private

Parameters

tld_length<Fixnum>:Number of domains levels to inlclude in the top level domain. Defaults to 1.

Returns

String:The full domain name without the port number.

:api: public

Notes

Find route using requested URI and merges route parameters (:action, :controller and named segments) into request params hash.

:api: private

Returns

String:The full URI, including protocol and host

:api: public

Returns

String:The gateway.

:api: public

Handles request routing and action dispatch

@return [Array[Integer, Hash, each]] A Rack response

@api private

If @route_params is an Array, then it will be the rack response. In this case, the request is considered handled.

Returns

Boolean:true if @route_params is an Array, false otherwise.

:api: private

Returns

String:The full hostname including the port.

:api: public

Returns

Value of If-Modified-Since request header.

:api: private

Returns

Value of If-None-Match request header.

:api: private

Returns

String:Value of HTTP_KEEP_ALIVE.

:api: public

Sets the request as matched. This will abort evaluating any further deferred procs.

:api: private

Checks whether or not the request has been matched to a route.

:api: private

Returns

String:Returns the redirect message Base64 unencoded.

:api: public

Returns

Symbol:The name of the request method, e.g. :get.

Notes

If the method is post, then the blocks specified in http_method_overrides will be checked for the masquerading method. The block will get the controller yielded to it. The first matching workaround wins. To disable this behavior, set http_method_overrides = []

:api: public

Returns

Mash:All request parameters.

Notes

The order of precedence for the params is XML, JSON, multipart, body and request string.

:api: public

Returns

String:The URI without the query string. Strips trailing "/" and reduces duplicate "/" to a single "/".

:api: public

Returns

String:The path info.

:api: public

Returns

Fixnum:The server port.

:api: public

Returns

String:The protocol, i.e. either "https" or "http" depending on the HTTPS header.

:api: public

Returns

String:The query string.

:api: private

Returns

(Array, Hash):the route params for the matched route.

Notes

If the response is an Array then it is considered a direct Rack response to be sent back as a response. Otherwise, the route_params is a Hash with routing data (controller, action, et al).

:api: private

Returns

String:The raw post.

:api: private

Returns

String:The HTTP referer.

:api: public

Returns

String:The remote IP address.

:api: public

Notes

Resets the params to a nil value.

:api: private

Returns

String:The script name.

:api: public

Returns

String:The server name.

:api: public

Returns

String:The server software.

:api: public

Returns

Boolean::True if the request is an SSL request.

:api: public

Parameters

tld_length<Fixnum>:Number of domains levels to inlclude in the top level domain. Defaults to 1.

Returns

Array:All the subdomain parts of the host.

:api: public

Returns

String:The request URI.

:api: public

Returns

String:The HTTP user agent.

:api: public

Returns

String:The HTTP version

:api: private

xhr?()

Alias for xml_http_request?

Returns

Boolean:If the request is an XML HTTP request.

:api: public

[Validate]