Returns the charset associated with this media type (charset
parameter).
Returns the charset associated with this media type (charset
parameter).
Sets the charset associated with this media type (charset
parameter).
Sets the charset associated with this media type (charset
parameter).
Returns the value of the requested parameter.
Returns the value of the requested parameter.
This is strictly a convenience method and will simply call the underlying parameter's MediaTypeParameters.getOpt method.
Sets the specified parameter to the specified value.
Sets the specified parameter to the specified value.
Creates a copy of the current instance with the specified parameters.
Parameters associated with this instance.
Raw string representation of the media type, ignoring parameters.
Removes the specified parameter.
Removes the specified parameter.
Matches any instance of Specific with the same main- and sub-type.
Convenience method that behaves exactly as MediaType.unapply on instances of Response.
Convenience method that behaves exactly as MediaType.unapply on instances of Response.
This is meant to make mapping on instances Request more convenient:
val req: Request[Response[ResponseEntity]] = ??? req.map { case res @ MediaType.Text(_) => println("Text content: " + res.body.as[String]) case MediaType(m) => println("Unsupported media type: " + m) }
Specific media type, with both a main- and sub-type (such as
text-plain
, for example).