Module

Payload.Server.Response

Package
purescript-payload
Repository
hoodunit/purescript-payload

This module contains various helpers for returning server responses.

#status Source

status :: forall a. HttpStatus -> a -> Response a

#setStatus Source

setStatus :: forall a. HttpStatus -> Response a -> Response a

#updateStatus Source

updateStatus :: forall a. (HttpStatus -> HttpStatus) -> Response a -> Response a

#setBody Source

setBody :: forall a b. b -> Response a -> Response b

#updateBody Source

updateBody :: forall a b. (a -> b) -> Response a -> Response b

#setHeaders Source

setHeaders :: forall a. Headers -> Response a -> Response a

#updateHeaders Source

updateHeaders :: forall a. (Headers -> Headers) -> Response a -> Response a

#ToSpecResponse Source

class ToSpecResponse (docRoute :: Symbol) a b  where

This type class is for converting types which are compatible with the spec into the spec type. If the spec says one type is returned from an endpoint, a handler can either return that type directly or return another type from which that type can be produced (e.g. a full response with different headers or a different status code).

Members

Instances

#EncodeResponse Source

class EncodeResponse r  where

Any types that can appear in a server response body and show up in the API spec under the "body" field must implement EncodeResponse. This is also a good place to add a Content-Type header for the encoded response.

Members

Instances

#continue Source

continue :: forall a. a -> Response a

Status code: 100

#switchingProtocols Source

switchingProtocols :: forall a. a -> Response a

Status code: 101

#processing Source

processing :: forall a. a -> Response a

Status code: 102

#ok Source

ok :: forall a. a -> Response a

Status code: 200

#created Source

created :: forall a. a -> Response a

Status code: 201

#accepted Source

accepted :: forall a. a -> Response a

Status code: 202

#nonAuthoritativeInformation Source

nonAuthoritativeInformation :: forall a. a -> Response a

Status code: 203

#noContent Source

noContent :: forall a. a -> Response a

Status code: 204

#resetContent Source

resetContent :: forall a. a -> Response a

Status code: 205

#partialContent Source

partialContent :: forall a. a -> Response a

Status code: 206

#multiStatus Source

multiStatus :: forall a. a -> Response a

Status code: 207

#alreadyReported Source

alreadyReported :: forall a. a -> Response a

Status code: 208

#imUsed Source

imUsed :: forall a. a -> Response a

Status code: 226

#multipleChoices Source

multipleChoices :: forall a. a -> Response a

Status code: 300

#movedPermanently Source

movedPermanently :: forall a. a -> Response a

Status code: 301

#found Source

found :: forall a. a -> Response a

Status code: 302

#seeOther Source

seeOther :: forall a. a -> Response a

Status code: 303

#notModified Source

notModified :: forall a. a -> Response a

Status code: 304

#useProxy Source

useProxy :: forall a. a -> Response a

Status code: 305

#temporaryRedirect Source

temporaryRedirect :: forall a. a -> Response a

Status code: 307

#permanentRedirect Source

permanentRedirect :: forall a. a -> Response a

Status code: 308

#badRequest Source

badRequest :: forall a. a -> Response a

Status code: 400

#unauthorized Source

unauthorized :: forall a. a -> Response a

Status code: 401

#paymentRequired Source

paymentRequired :: forall a. a -> Response a

Status code: 402

#forbidden Source

forbidden :: forall a. a -> Response a

Status code: 403

#notFound Source

notFound :: forall a. a -> Response a

Status code: 404

#methodNotAllowed Source

methodNotAllowed :: forall a. a -> Response a

Status code: 405

#notAcceptable Source

notAcceptable :: forall a. a -> Response a

Status code: 406

#proxyAuthenticationRequired Source

proxyAuthenticationRequired :: forall a. a -> Response a

Status code: 407

#requestTimeout Source

requestTimeout :: forall a. a -> Response a

Status code: 408

#conflict Source

conflict :: forall a. a -> Response a

Status code: 409

#gone Source

gone :: forall a. a -> Response a

Status code: 410

#lengthRequired Source

lengthRequired :: forall a. a -> Response a

Status code: 411

#preconditionFailed Source

preconditionFailed :: forall a. a -> Response a

Status code: 412

#payloadTooLarge Source

payloadTooLarge :: forall a. a -> Response a

Status code: 413

#uriTooLong Source

uriTooLong :: forall a. a -> Response a

Status code: 414

#unsupportedMediaType Source

unsupportedMediaType :: forall a. a -> Response a

Status code: 415

#rangeNotSatisfiable Source

rangeNotSatisfiable :: forall a. a -> Response a

Status code: 416

#expectationFailed Source

expectationFailed :: forall a. a -> Response a

Status code: 417

#imATeapot Source

imATeapot :: forall a. a -> Response a

Status code: 418

#misdirectedRequest Source

misdirectedRequest :: forall a. a -> Response a

Status code: 421

#unprocessableEntity Source

unprocessableEntity :: forall a. a -> Response a

Status code: 422

#locked Source

locked :: forall a. a -> Response a

Status code: 423

#failedDependency Source

failedDependency :: forall a. a -> Response a

Status code: 424

#upgradeRequired Source

upgradeRequired :: forall a. a -> Response a

Status code: 426

#preconditionRequired Source

preconditionRequired :: forall a. a -> Response a

Status code: 428

#tooManyRequests Source

tooManyRequests :: forall a. a -> Response a

Status code: 429

#requestHeaderFieldsTooLarge Source

requestHeaderFieldsTooLarge :: forall a. a -> Response a

Status code: 431

#unavailableForLegalReasons Source

unavailableForLegalReasons :: forall a. a -> Response a

Status code: 451

#internalError Source

internalError :: forall a. a -> Response a

Status code: 500

#notImplemented Source

notImplemented :: forall a. a -> Response a

Status code: 501

#badGateway Source

badGateway :: forall a. a -> Response a

Status code: 502

#serviceUnavailable Source

serviceUnavailable :: forall a. a -> Response a

Status code: 503

#gatewayTimeout Source

gatewayTimeout :: forall a. a -> Response a

Status code: 504

#httpVersionNotSupported Source

httpVersionNotSupported :: forall a. a -> Response a

Status code: 505

#variantAlsoNegotiates Source

variantAlsoNegotiates :: forall a. a -> Response a

Status code: 506

#insufficientStorage Source

insufficientStorage :: forall a. a -> Response a

Status code: 507

#loopDetected Source

loopDetected :: forall a. a -> Response a

Status code: 508

#notExtended Source

notExtended :: forall a. a -> Response a

Status code: 510

#networkAuthenticationRequired Source

networkAuthenticationRequired :: forall a. a -> Response a

Status code: 511