Yoga.HTTP.API.Route.HeaderValue
- Package
- purescript-yoga-http-api
- Repository
- rowtype-yoga/purescript-yoga-http-api
#HeaderValue Source
class HeaderValue a whereTypeclass for values that can be parsed from and printed to HTTP header strings
This mirrors the ParseParam pattern from path parsing and allows headers
to be typed beyond just strings.
Returns Either String for detailed error messages (the string is the reason, not the header name).
Examples: parseHeader "42" :: Either String Int = Right 42 parseHeader "bad" :: Either String Int = Left "not a valid integer" printHeader 42 = "42" parseHeader "hello" :: Either String String = Right "hello"
Members
parseHeader :: String -> Either String aprintHeader :: a -> String
Instances
HeaderValue StringHeaderValue IntInteger headers are parsed from strings
(HeaderValue a) => HeaderValue (Maybe a)Optional headers (Maybe a) where a has HeaderValue This instance allows headers to be optional Note: parseHeader always succeeds for Maybe types (returns Just or Nothing)
#HeaderValueType Source
class HeaderValueType (ty :: Type) whereGet OpenAPI type string for a HeaderValue type
Members
headerValueType :: Proxy ty -> String
Instances
- Modules
- Yoga.
HTTP. API. Path - Yoga.
HTTP. API. Route - Yoga.
HTTP. API. Route. Auth - Yoga.
HTTP. API. Route. BearerToken - Yoga.
HTTP. API. Route. Encoding - Yoga.
HTTP. API. Route. Handler - Yoga.
HTTP. API. Route. HeaderError - Yoga.
HTTP. API. Route. HeaderValue - Yoga.
HTTP. API. Route. Method - Yoga.
HTTP. API. Route. OpenAPI - Yoga.
HTTP. API. Route. OpenAPIMetadata - Yoga.
HTTP. API. Route. RenderMethod - Yoga.
HTTP. API. Route. Response - Yoga.
HTTP. API. Route. Route - Yoga.
HTTP. API. Route. RouteHandler - Yoga.
HTTP. API. Route. StatusCode
String headers are pass-through (identity)