| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Okapi.HTTP.Request.Headers
Synopsis
- data Headers a where
- Raw :: Headers [Header]
- Field :: forall a. HeaderName -> Leaf Headers a -> Headers a
- Field' :: forall a1. HeaderName -> Leaf Headers a1 -> Headers (Maybe a1)
- Field_ :: HeaderName -> ByteString -> Headers ()
- FieldRFC9651 :: forall a. HeaderName -> Tree RFC9651 a a -> Headers a
- Cookie :: forall a. ByteString -> Leaf Cookie a -> Headers a
- Cookie' :: forall a1. ByteString -> Leaf Cookie a1 -> Headers (Maybe a1)
- data ParseError = ParseError
- parser :: Tree Headers i o -> Parser Headers o
- printer :: Tree Headers i o -> Printer Headers i
- coalesceCookies :: [Header] -> [Header]
- raw :: Tree Headers RequestHeaders RequestHeaders
- field :: HeaderName -> Leaf Headers a -> Tree Headers a a
- field' :: HeaderName -> Leaf Headers a -> Tree Headers (Maybe a) (Maybe a)
- field_ :: HeaderName -> ByteString -> Tree Headers h h -> Tree Headers h h
- fieldRFC9651 :: HeaderName -> Tree RFC9651 a a -> Tree Headers a a
- fieldBareItem :: HeaderName -> Leaf (BareItem :: Type -> Type) a -> Tree Headers a a
- fieldItem :: HeaderName -> Tree Item a a -> Tree Headers a a
- fieldList :: HeaderName -> Tree List a a -> Tree Headers a a
- fieldDictionary :: HeaderName -> Tree Dictionary a a -> Tree Headers a a
- contentType :: MediaType -> Tree Headers h h -> Tree Headers h h
- cookie :: ByteString -> Leaf Cookie a -> Tree Headers a a
- cookie' :: ByteString -> Leaf Cookie a -> Tree Headers (Maybe a) (Maybe a)
- data MediaType
- data ConstF (val :: Symbol) = ConstF
- class GHeaders (f :: Type -> Type) where
- gHeadersCodec :: Tree Headers (f ()) (f ())
- headersCodec :: (Generic a, GHeaders (Rep a)) => Tree Headers a a
Documentation
Constructors
| Raw :: Headers [Header] | |
| Field :: forall a. HeaderName -> Leaf Headers a -> Headers a | |
| Field' :: forall a1. HeaderName -> Leaf Headers a1 -> Headers (Maybe a1) | |
| Field_ :: HeaderName -> ByteString -> Headers () | |
| FieldRFC9651 :: forall a. HeaderName -> Tree RFC9651 a a -> Headers a | |
| Cookie :: forall a. ByteString -> Leaf Cookie a -> Headers a | |
| Cookie' :: forall a1. ByteString -> Leaf Cookie a1 -> Headers (Maybe a1) |
Instances
| HasLeaf Headers ByteString Source # | |
Defined in Okapi.HTTP.Request.Headers | |
| HasLeaf Headers Int16 Source # | |
| HasLeaf Headers Int32 Source # | |
| HasLeaf Headers Int64 Source # | |
| HasLeaf Headers Text Source # | |
| HasLeaf Headers Day Source # | |
| HasLeaf Headers DiffTime Source # | |
| HasLeaf Headers UTCTime Source # | |
| HasLeaf Headers LocalTime Source # | |
| HasLeaf Headers TimeOfDay Source # | |
| HasLeaf Headers UUID Source # | |
| HasLeaf Headers Integer Source # | |
| HasLeaf Headers Bool Source # | |
| HasLeaf Headers Double Source # | |
| HasLeaf Headers Float Source # | |
| HasLeaf Headers Int Source # | |
| HasLeaf Headers (TimeOfDay, TimeZone) Source # | |
| type Context Headers Source # | |
Defined in Okapi.HTTP.Request.Headers | |
| type Failure Headers Source # | |
Defined in Okapi.HTTP.Request.Headers | |
| type Piece Headers Source # | |
Defined in Okapi.HTTP.Request.Headers | |
data ParseError Source #
Constructors
| ParseError |
Instances
| Show ParseError Source # | |
Defined in Okapi.HTTP.Request.Headers Methods showsPrec :: Int -> ParseError -> ShowS # show :: ParseError -> String # showList :: [ParseError] -> ShowS # | |
| Eq ParseError Source # | |
Defined in Okapi.HTTP.Request.Headers | |
coalesceCookies :: [Header] -> [Header] Source #
field :: HeaderName -> Leaf Headers a -> Tree Headers a a Source #
Parse and print a required request header field.
printParse parser printer (field "x-foo" int) (x :: Int)
printStable parser printer (field "x-foo" int) (x :: Int)
field' :: HeaderName -> Leaf Headers a -> Tree Headers (Maybe a) (Maybe a) Source #
Parse and print an optional request header field.
printParse parser printer (field' "x-foo" int) (x :: Maybe Int)
field_ :: HeaderName -> ByteString -> Tree Headers h h -> Tree Headers h h Source #
fieldRFC9651 :: HeaderName -> Tree RFC9651 a a -> Tree Headers a a Source #
fieldBareItem :: HeaderName -> Leaf (BareItem :: Type -> Type) a -> Tree Headers a a Source #
fieldDictionary :: HeaderName -> Tree Dictionary a a -> Tree Headers a a Source #
cookie :: ByteString -> Leaf Cookie a -> Tree Headers a a Source #
Parse and print a required request cookie.
printParse parser printer (cookie "sid" int) (x :: Int)
printStable parser printer (cookie "sid" int) (x :: Int)
cookie' :: ByteString -> Leaf Cookie a -> Tree Headers (Maybe a) (Maybe a) Source #
Parse and print an optional request cookie.
printParse parser printer (cookie' "sid" int) (x :: Maybe Int)
Constructors
| JSON | |
| HTML | |
| PlainText | |
| FormUrlEncoded | |
| OctetStream | |
| EventStream | |
| Custom ByteString |
data ConstF (val :: Symbol) Source #
Constructors
| ConstF |
class GHeaders (f :: Type -> Type) where Source #
Methods
gHeadersCodec :: Tree Headers (f ()) (f ()) Source #
Instances
| (GHeaders f, GHeaders g) => GHeaders (f :*: g) Source # | |
Defined in Okapi.HTTP.Request.Headers | |
| GHeaders f => GHeaders (C1 meta f) Source # | |
Defined in Okapi.HTTP.Request.Headers | |
| GHeaders f => GHeaders (D1 meta f) Source # | |
Defined in Okapi.HTTP.Request.Headers | |
| (Selector s, KnownSymbol val) => GHeaders (S1 s (Rec0 (ConstF val))) Source # | |
| (Selector s, HasLeaf Headers a) => GHeaders (S1 s (Rec0 (Maybe a))) Source # | |
| (Selector s, HasLeaf Headers a) => GHeaders (S1 s (Rec0 a)) Source # | |
Defined in Okapi.HTTP.Request.Headers | |