Represents an acceptable value for content negotiation headers (Accept*
).
Represents an acceptable value for content negotiation headers (Accept*
).
value of the header (see the companion object for header formats).
weight of the value, as a float between 0 and 1 inclusive. Bigger weights tell remote servers that the corresponding value is more desirable than values associated with lower weights.
Used to parse / serialize content negotiation header values.
Used to parse / serialize content negotiation header values.
In order to implement a format for a specific type, application developers only need to provide a Parser
instance for that type by implementing the entry method.
Represents HTTP entity tags.
Handles HTTP content encoding.
Represents an entity's language.
Represents an entity's language.
These can be used for content negotiation or to describe the language in which a response is written.
A language can either be global or country-specific.
Stores a list of name / value pairs.
Stores a list of name / value pairs.
Values are stored in their serialized forms as String
, but can be manipulated as more specific types provided
corresponding instances of ValueReader and ValueWriter are in scope. Default implementations of these
can be found in ValueFormat.
Represents a valid URL protocol.
Represents a valid URL protocol.
Supported protocols are declared in the companion object.
Protocol
instances can be used to easily create urls:
// Verbose: Protocol.Http.host("github.com") // Syntactic sugar: Protocol.Http :/ "github.com"
Represents an Url's query string.
Represents an HTTP request.
Represents an HTTP request.
Instances are created through the companion object. Once an instance is obtained, the request can be configured through "raw" modification methods (
method
,
headers
...) as well as specialised helpers such as
GET
,
acceptGzip
or
/
.
/ }}}
acceptGzip }}}
GET }}}
headers }}} as
GET
,
acceptGzip
or
/
.
/ }}}
acceptGzip }}}
GET }}}
method }}} as
GET
,
acceptGzip
or
/
.
/ }}}
acceptGzip }}}
GET }}}
Represents an HTTP response.
Represents a raw response entity.
Represents an HTTP status code, as defined in RFC 2616.
Represents an HTTP status code, as defined in RFC 2616.
This class and its companion objects provide various extraction helpers to ease pattern matching. For example:
val res: Response[ResponseEntity] = ??? res.status match { case Status.Success(_) => println("Success") case _ => println("Not success") }
It's also possible to pattern match directly on instances of Response, which can be useful when mapping on requests:
val res: Request[Response[ResponseEntity]] = ??? res map { // Match on the 2xx group case res @ Status.Success(_) => println("Success: " + res.body.as[String]) // Match on HTTP 500 case Status.InternalServerError(_) => println("Internal server error") // Match on everything else case _ => println("Something else entirely") }
See the companion object for known status codes.
Compounds a ValueReader and ValueWriter.
Used to read parameter values from an instance of Parameters.
Used to read parameter values from an instance of Parameters.
Used to write parameter values to an instance of Parameters.
Used to write parameter values to an instance of Parameters.
Collection of implicit header formats for known content negotiation headers.
Charset used for request or response entities when none is specified.
Tools for creating instances of Language.
Defines MediaType implementations as well as known types.
Declares known protocols and provides convenience methods.
Defines known HTTP status codes, as well as pattern match helpers.
Writes the content of the specified input stream to the specified output stream.
Writes the content of the specified input stream to the specified output stream. Note that this method does not wrap its arguments in buffered streams, nor will it close either stream.
Writes the content of the specified reader to the specified writer.
Writes the content of the specified reader to the specified writer. Note that this method does not wrap its arguments in buffered implementations, nor will it close either stream.