package types
Defines standardized types for header classes in scamper.headers.
import scamper.Implicits.{ stringToEntity, stringToUri } import scamper.RequestMethods.GET import scamper.ResponseStatuses.Ok import scamper.headers.{ Accept, ContentType, TransferEncoding } import scamper.types.{ MediaRange, MediaType, TransferCoding } val json = MediaRange("application", "json", 0.9f) val html = MediaRange.parse("text/html; q=0.1") val req = GET("/motd").withAccept(json, html) val text = MediaType.parse("text/plain") val gzip = TransferCoding("gzip") val res = Ok("There is an answer.").withContentType(text).withTransferEncoding(gzip)
Using values defined in Implicits, properly formatted strings can be implicitly converted to standardized types.
import scamper.Implicits.{ stringToEntity, stringToUri } import scamper.RequestMethods.GET import scamper.ResponseStatuses.Ok import scamper.headers.{ Accept, ContentType, TransferEncoding } import scamper.types.Implicits._ val req = GET("/motd").withAccept("application/json; q=0.9", "text/html; q=0.1") val res = Ok("There is an answer.").withContentType("text/plain").withTransferEncoding("gzip")
- Alphabetic
- By Inheritance
- types
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- trait ByteContentRange extends ContentRangeType
Standardized type for Content-Range header value.
Standardized type for Content-Range header value.
- See also
- trait ByteRange extends RangeType
Standardized type for Range header value.
Standardized type for Range header value.
- See also
- trait CacheDirective extends AnyRef
Standardized type for Cache-Control header value.
Standardized type for Cache-Control header value.
- See also
- trait CharsetRange extends AnyRef
Standardized type for Accept-Charset header value.
Standardized type for Accept-Charset header value.
- See also
- trait ContentCoding extends AnyRef
Standardized type for Content-Encoding header value.
Standardized type for Content-Encoding header value.
- See also
- trait ContentCodingRange extends AnyRef
Standardized type for Accept-Encoding header value.
Standardized type for Accept-Encoding header value.
- See also
- trait ContentRangeType extends AnyRef
Standardized type for Content-Range header value.
Standardized type for Content-Range header value.
- See also
- trait DispositionType extends AnyRef
Standardized type for Content-Disposition header value.
Standardized type for Content-Disposition header value.
- trait EntityTag extends AnyRef
Standardized type for ETag, If-Match, If-None-Match, and If-Range header value.
Standardized type for ETag, If-Match, If-None-Match, and If-Range header value.
- trait LanguageRange extends AnyRef
Standardized type for Accept-Language header value.
Standardized type for Accept-Language header value.
- See also
- trait LanguageTag extends AnyRef
Standardized type for Content-Language header value.
Standardized type for Content-Language header value.
- See also
- trait LinkValue extends AnyRef
Standardized type for Link header value.
Standardized type for Link header value.
- See also
- trait MediaRange extends AnyRef
Standardized type for Accept header value.
Standardized type for Accept header value.
- See also
- trait MediaType extends AnyRef
Standardized type for Content-Type header value.
Standardized type for Content-Type header value.
- See also
- trait PragmaDirective extends AnyRef
Standardized type for Pragma header value.
Standardized type for Pragma header value.
- See also
- trait Preference extends AnyRef
Standardized type for Prefer and Preference-Applied header values.
Standardized type for Prefer and Preference-Applied header values.
- trait ProductType extends AnyRef
Standardized type for User-Agent and Server header value.
Standardized type for User-Agent and Server header value.
- trait Protocol extends AnyRef
Standardized type for Upgrade header value.
Standardized type for Upgrade header value.
- See also
- trait RangeType extends AnyRef
Standardized type for Range header value.
Standardized type for Range header value.
- See also
- trait TransferCoding extends AnyRef
Standardized type for Transfer-Encoding header value.
Standardized type for Transfer-Encoding header value.
- See also
- trait TransferCodingRange extends AnyRef
Standardized type for TE header value.
Standardized type for TE header value.
- See also
- trait ViaType extends AnyRef
Standardized type for Via header value.
Standardized type for Via header value.
- See also
- trait WarningType extends AnyRef
Standardized type for Warning header value.
Standardized type for Warning header value.
- See also
Value Members
- object ByteContentRange
ByteContentRange factory
- object ByteRange
ByteRange factory
- object CacheDirective
CacheDirective factory
- object CacheDirectives extends Product with Serializable
Registered cache directives
- object CharsetRange
CharsetRange factory
- object ContentCoding
ContentCoding factory
- object ContentCodingRange
ContentCodingRange factory
- object DispositionType
DispositionType factory
- object EntityTag
EntityTag factory
- object Implicits
Contains implicit converter functions.
- object LanguageRange
LanguageRange factory
- object LanguageTag
LanguageTag factory
- object LinkValue
LinkValue factory
- object MediaRange
MediaRange factory
- object MediaType
MediaType factory
- object PragmaDirective
PragmaDirective factory
- object PragmaDirectives extends Product with Serializable
Registered pragma directives
- object Preference
Preference factory
- object Preferences
Registered preferences
- object ProductType
ProductType factory
- object Protocol
Protocol factory
- object TransferCoding
TransferCoding factory
- object TransferCodingRange
TransferCodingRange factory
- object ViaType
ViaType factory
- object WarningType
WarningType factory