servant-0.13: A family of combinators for defining webservices APIs

Safe HaskellNone
LanguageHaskell2010

Servant.API

Contents

Synopsis

Combinators

Type-level combinator for expressing subrouting: :>

Type-level combinator for alternative endpoints: :<|>

Type-level combinator for an empty API: EmptyAPI

Type-level modifiers for QueryParam, Header and ReqBody.

Accessing information from the request

Capturing parts of the url path as parsed values: Capture and CaptureAll

Retrieving specific headers from the request

Retrieving the HTTP version of the request

Retrieving parameters from the query string of the URI: QueryParam

Accessing the request body as a JSON-encoded type: ReqBody

Retrieving the IP of the client

Is the request made through HTTPS?

Access the location for arbitrary data to be shared by applications and middleware

Access context entries in combinators in servant-server

Actual endpoints, distinguished by HTTP method

Streaming endpoints, distinguished by HTTP method

Authentication

Endpoints description

Content Types

Serializing and deserializing types based on Accept and Content-Type headers.

Response Headers

Untyped endpoints

Plugging in a wai Application, serving directories

FromHttpApiData and ToHttpApiData

Classes and instances for types that can be converted to and from HTTP API data.

Experimental modules

General Authentication

Utilities

Type-safe internal URIs

Re-exports

type family If k (cond :: Bool) (tru :: k) (fls :: k) :: k where ... #

Type-level If. If True a b ==> a; If False a b ==> b

Equations

If k True tru fls = tru 
If k False tru fls = fls 

data SBool (b :: Bool) :: Bool -> * where #

Constructors

STrue :: SBool True 
SFalse :: SBool False 

class SBoolI (b :: Bool) where #

Minimal complete definition

sbool

Methods

sbool :: SBool b #

Instances