webgear-server-0.1.0: Composable, type-safe library to build HTTP API servers
Copyright(c) Raghu Kaippully 2020
LicenseMPL-2.0
Maintainerrkaippully@gmail.com
Safe HaskellNone
LanguageHaskell2010

WebGear.Trait.Header

Description

Traits related to HTTP headers.

Synopsis

Documentation

data Header (s :: Symbol) (t :: Type) Source #

A Trait for capturing a header with name s in a request or response and convert it to some type t via FromHttpApiData.

Instances

Instances details
(KnownSymbol s, FromHttpApiData t, Monad m) => Trait (Header s t :: Type) Request m Source # 
Instance details

Defined in WebGear.Trait.Header

Associated Types

type Val (Header s t) Request Source #

type Fail (Header s t) Request Source #

Methods

check :: Request -> m (CheckResult (Header s t) Request) Source #

type Val (Header s t :: Type) Request Source # 
Instance details

Defined in WebGear.Trait.Header

type Val (Header s t :: Type) Request = t
type Fail (Header s t :: Type) Request Source # 
Instance details

Defined in WebGear.Trait.Header

data HeaderFail Source #

Failure in extracting a header value

data HeaderMatch (s :: Symbol) (t :: Symbol) Source #

A Trait for ensuring that a header named s has value t.

Instances

Instances details
(KnownSymbol s, KnownSymbol t, Monad m) => Trait (HeaderMatch s t :: Type) Request m Source # 
Instance details

Defined in WebGear.Trait.Header

Associated Types

type Val (HeaderMatch s t) Request Source #

type Fail (HeaderMatch s t) Request Source #

type Val (HeaderMatch s t :: Type) Request Source # 
Instance details

Defined in WebGear.Trait.Header

type Fail (HeaderMatch s t :: Type) Request Source # 
Instance details

Defined in WebGear.Trait.Header