class Marten::HTTP::Response
- Marten::HTTP::Response
- Reference
- Object
Overview
Represents an HTTP response.
This class allows to manipulate HTTP responses. These objects are associated with a specific HTTP response status, and they can define an associated content (and content type) as well as additional headers.
Direct Known Subclasses
- Marten::HTTP::Response::BadRequest
- Marten::HTTP::Response::Forbidden
- Marten::HTTP::Response::Found
- Marten::HTTP::Response::Gone
- Marten::HTTP::Response::InternalServerError
- Marten::HTTP::Response::MethodNotAllowed
- Marten::HTTP::Response::MovedPermanently
- Marten::HTTP::Response::NotFound
- Marten::HTTP::Response::SeeOther
Defined in:
marten/http/response.crmarten/http/response/bad_request.cr
marten/http/response/forbidden.cr
marten/http/response/found.cr
marten/http/response/gone.cr
marten/http/response/internal_server_error.cr
marten/http/response/method_not_allowed.cr
marten/http/response/moved_permanently.cr
marten/http/response/not_found.cr
marten/http/response/see_other.cr
Constant Summary
- 
        DEFAULT_CONTENT_TYPE = "text/html"
Constructors
Instance Method Summary
- 
        #[]=(header : String | Symbol, value)
        
          Allows to set a specific header. 
- 
        #content : String
        
          Returns the content associated with the HTTP response. 
- 
        #content=(content : String)
        
          Allows to overridde the response's content. 
- 
        #content_type : String
        
          Returns the content type associated with the HTTP response. 
- 
        #cookies : Marten::HTTP::Cookies
        
          Returns the cookies associated with the HTTP response. 
- 
        #headers : Marten::HTTP::Headers
        
          Returns the headers associated with the HTTP response. 
- 
        #status : Int32
        
          Returns the status code of the HTTP response. 
Macro Summary
Constructor Detail
        
        def self.new(content : String = "", content_type : String = DEFAULT_CONTENT_TYPE, status : Int32 = 200)
        #