class
Marten::HTTP::Headers
- Marten::HTTP::Headers
- Reference
- Object
Overview
Represents a set of HTTP headers extracted from an HTTP request.
Included Modules
Defined in:
marten/http/headers.crConstructors
Instance Method Summary
-
#==(other : self)
Returns true if the other headers object corresponds to the current headers.
-
#[](name : String | Symbol)
Returns the first value associated with the passed header name.
-
#[]=(name : String | Symbol, value)
Allows to set a specific header.
-
#[]?(name : String | Symbol)
Returns the first value associated with the passed header name or
nilif the header is not present. -
#delete(name : String | Symbol) : String | Nil
Deletes a specific header and return its value, or
nilif the header does not exist. -
#each(*args, **options)
Allows to iterate over all the headers.
-
#each(*args, **options, &)
Allows to iterate over all the headers.
-
#empty?(*args, **options)
Returns
trueif there are no headers. -
#empty?(*args, **options, &)
Returns
trueif there are no headers. -
#fetch(name : String | Symbol, default = nil)
Returns the value of the specified header name or fallback to the provided default value ( which is
nilby default). -
#fetch(name : String | Symbol, &)
Returns the value of the specified header name or calls the block with the name when not found.
-
#has_key?(name : String | Symbol)
Returns
trueif the header with the provided name exists. -
#patch_vary(*headers : String) : Nil
Allows to add header names to the Vary header.
-
#size(*args, **options)
Returns the number of headers.
-
#size(*args, **options, &)
Returns the number of headers.
Constructor Detail
Instance Method Detail
Returns the first value associated with the passed header name.
Returns the first value associated with the passed header name or nil if the header is not present.
Deletes a specific header and return its value, or nil if the header does not exist.
Returns the value of the specified header name or fallback to the provided default value ( which is nilby
default).
Returns the value of the specified header name or calls the block with the name when not found.
Returns true if the header with the provided name exists.
Allows to add header names to the Vary header.