class Marten::HTTP::Request
- Marten::HTTP::Request
- Reference
- Object
Overview
Represents an HTTP request processed by Marten.
When a page is request, Marten creates a Marten::HTTP::Request that gives access to all the information and
metadata of the incoming request.
Included Modules
Defined in:
marten/http/request.crmarten/template/ext/http/request.cr
Constructors
Instance Method Summary
- 
        #accepted_media_types : Array(MIME::MediaType)
        
          Returns an array of the media types accepted by the request. 
- 
        #accepts?(media_type : String)
        
          Returns trueif the passed media type is accepted by the request.
- 
        #body : String
        
          Returns the raw body of the request as a string. 
- 
        #cookies
        
          Returns the cookies associated with the request. 
- 
        #data : Params::Data
        
          Returns the parsed request data. 
- 
        #delete?
        
          Returns trueif the request is a DELETE.
- 
        #flash
        
          Returns the flash store for the considered request. 
- 
        #flash=(flash_store : FlashStore)
        
          Allows to set the flash store for the request. 
- 
        #full_path : String
        
          Returns the path including the GET parameters if applicable. 
- 
        #get?
        
          Returns trueif the request is a GET.
- 
        #head?
        
          Returns trueif the request is a HEAD.
- 
        #headers : Headers
        
          Returns the HTTP headers embedded in the request. 
- 
        #host : String
        
          Returns the host associated with the considered request. 
- 
        #method : String
        
          Returns a string representation of HTTP method that was used in the request. 
- 
        #options?
        
          Returns trueif the request is an OPTIONS.
- 
        #patch?
        
          Returns trueif the request is a PATCH.
- 
        #path : String
        
          Returns the request path as a string. 
- 
        #port : String | Nil
        
          Returns the port associated with the considered request. 
- 
        #post?
        
          Returns trueif the request is a POST.
- 
        #put?
        
          Returns trueif the request is a PUT.
- 
        #query_params : Params::Query
        
          Returns the HTTP GET parameters embedded in the request. 
- 
        #scheme : String
        
          Returns the scheme of the request (either "http"or"https").
- 
        #secure?
        
          Returns trueif the request is secure (if it is an HTTPS request).
- 
        #session
        
          Returns the session store for the considered request. 
- 
        #session=(session_store : Session::Store::Base)
        
          Allows to set the session store for the request. 
- 
        #trace?
        
          Returns trueif the request is a TRACE.
Constructor Detail
Instance Method Detail
Returns an array of the media types accepted by the request.
Returns true if the passed media type is accepted by the request.
Returns the flash store for the considered request.
If no flash store was previously set (for example if the flash middleware is not used), a NilAssertionError
exception will be raised.
Returns a string representation of HTTP method that was used in the request.
The returned method name (eg. "GET" or "POST") is completely uppercase.
Returns the request path as a string.
Only the path of the request is included (without scheme or domain).
Returns the session store for the considered request.
If no session store was previously set (for example if the session middleware is not set), a NilAssertionError
exception will be raised.
Allows to set the session store for the request.