servant-benchmark-0.1.2.0: Generate benchmark files from a Servant API
Safe HaskellSafe-Inferred
LanguageHaskell2010

Servant.Benchmark.Endpoint

Synopsis

Documentation

data Endpoint Source #

An API endpoint. -

Constructors

MkEndpoint 

Fields

  • name :: Text
     
  • path :: Text
     
  • method :: Maybe Method
     
  • body :: Maybe ByteString

    The request value, where applicable. Only the first encountered request value is taken into consideration eg. "user" :> ReqBody '[JSON] Text :> ReqBody '[JSON] Int :> Get '[JSON] User will produce only a Text based request value

  • contentType :: Maybe MediaType

    The requests content type. Only the first encountered content type is taken into consideration. If you're building an endpoint manually, you should enter the media type here rather than directly in headers. All implementations automatically include the content type header during benchmark configuration output.

  • headers :: [Header]

    The request headers

Instances

Instances details
Eq Endpoint Source # 
Instance details

Defined in Servant.Benchmark.Endpoint

Show Endpoint Source # 
Instance details

Defined in Servant.Benchmark.Endpoint

Semigroup Endpoint Source # 
Instance details

Defined in Servant.Benchmark.Endpoint

Monoid Endpoint Source # 
Instance details

Defined in Servant.Benchmark.Endpoint

pack :: Endpoint -> Endpoint Source #

Pack an endpoint created from an API interpretation in a form ready to be serialized. - This is only useful if your are building your own output.

mkHeader :: Text -> Text -> Header Source #

Create a Header from two Text inputs

Content Types

ctJSON :: MediaType Source #

application/json

ctPlainText :: MediaType Source #

text/plain ; charset=utf-8