HTTPure
- Package
- purescript-httpure
- Repository
- cprussin/purescript-httpure
Re-exports from HTTPure.Headers
#Headers Source
newtype HeadersThe Headers type is just sugar for a Object of Strings
that represents the set of headers in an HTTP request or response.
Instances
Re-exports from HTTPure.Lookup
#(!@) Source
Operator alias for HTTPure.Lookup.at (left-associative / precedence 8)
Expose at as the infix operator !@
#(!?) Source
Operator alias for HTTPure.Lookup.has (left-associative / precedence 8)
Expose has as the infix operator !?
#(!!) Source
Operator alias for HTTPure.Lookup.lookup (left-associative / precedence 8)
!! is inspired by !! in Data.Array, but note that it differs from
!! in Data.Array in that you can use !! for any other instance of
Lookup.
Re-exports from HTTPure.Method
Re-exports from HTTPure.Path
#Path Source
type Path = Array StringThe Path type is just sugar for an Array of String segments that are
sent in a request and indicates the path of the resource being requested.
Note that this type has an implementation of Lookup for Int keys
defined by lookupArray in Lookup.purs because
lookupArray is defined for any Array of Monoids. So you can do
something like path !! 2 to get the path segment at index 2.
Re-exports from HTTPure.Query
#Query Source
type Query = Object StringThe Query type is a Object of Strings, with one entry per query
parameter in the request. For any query parameters that don't have values
(/some/path?query or /some/path?query=), the value in the Object for
that parameter will be the an empty string. Note that this type has an
implementation of Lookup for String keys defined by lookupObject in
Lookup.purs because lookupObject is defined for any
Object of Monoids. So you can do something like query !! "foo" to get
the value of the query parameter "foo".
Re-exports from HTTPure.Request
Re-exports from HTTPure.Response
#variantAlsoNegotiates' Source
variantAlsoNegotiates' :: Headers -> ResponseM506 with headers
#upgradeRequired' Source
upgradeRequired' :: Headers -> ResponseM426 with headers
#upgradeRequired Source
upgradeRequired :: ResponseM426
#unsupportedMediaType' Source
unsupportedMediaType' :: Headers -> ResponseM415 with headers
#unprocessableEntity' Source
unprocessableEntity' :: Headers -> ResponseM422 with headers
#unprocessableEntity Source
unprocessableEntity :: ResponseM422
#unauthorized' Source
unauthorized' :: Headers -> ResponseM401 with headers
#unauthorized Source
unauthorized :: ResponseM401
#uRITooLong' Source
uRITooLong' :: Headers -> ResponseM414 with headers
#uRITooLong Source
uRITooLong :: ResponseM414
#tooManyRequests' Source
tooManyRequests' :: Headers -> ResponseM429 with headers
#tooManyRequests Source
tooManyRequests :: ResponseM429
#temporaryRedirect' Source
temporaryRedirect' :: forall b. Body b => Headers -> b -> ResponseM307 with headers
#temporaryRedirect Source
temporaryRedirect :: forall b. Body b => b -> ResponseM307
#switchingProtocols' Source
switchingProtocols' :: Headers -> ResponseM101 with headers
#switchingProtocols Source
switchingProtocols :: ResponseM101
#resetContent' Source
resetContent' :: Headers -> ResponseM205 with headers
#resetContent Source
resetContent :: ResponseM205
#requestTimeout' Source
requestTimeout' :: Headers -> ResponseM408 with headers
#requestTimeout Source
requestTimeout :: ResponseM408
#requestHeaderFieldsTooLarge' Source
requestHeaderFieldsTooLarge' :: Headers -> ResponseM431 with headers
#rangeNotSatisfiable' Source
rangeNotSatisfiable' :: Headers -> ResponseM416 with headers
#rangeNotSatisfiable Source
rangeNotSatisfiable :: ResponseM416
#proxyAuthenticationRequired' Source
proxyAuthenticationRequired' :: Headers -> ResponseM407 with headers
#processing' Source
processing' :: Headers -> ResponseM102 with headers
#processing Source
processing :: ResponseM102
#preconditionRequired' Source
preconditionRequired' :: Headers -> ResponseM428 with headers
#preconditionFailed' Source
preconditionFailed' :: Headers -> ResponseM412 with headers
#preconditionFailed Source
preconditionFailed :: ResponseM412
#permanentRedirect' Source
permanentRedirect' :: forall b. Body b => Headers -> b -> ResponseM308 with headers
#permanentRedirect Source
permanentRedirect :: forall b. Body b => b -> ResponseM308
#paymentRequired' Source
paymentRequired' :: Headers -> ResponseM402 with headers
#paymentRequired Source
paymentRequired :: ResponseM402
#payloadTooLarge' Source
payloadTooLarge' :: Headers -> ResponseM413 with headers
#payloadTooLarge Source
payloadTooLarge :: ResponseM413
#partialContent' Source
partialContent' :: forall b. Body b => Headers -> b -> ResponseM206 with headers
#partialContent Source
partialContent :: forall b. Body b => b -> ResponseM206
#notModified' Source
notModified' :: Headers -> ResponseM304 with headers
#notModified Source
notModified :: ResponseM304
#notImplemented' Source
notImplemented' :: Headers -> ResponseM501 with headers
#notImplemented Source
notImplemented :: ResponseM501
#notExtended' Source
notExtended' :: Headers -> ResponseM510 with headers
#notExtended Source
notExtended :: ResponseM510
#notAcceptable' Source
notAcceptable' :: Headers -> ResponseM406 with headers
#notAcceptable Source
notAcceptable :: ResponseM406
#nonAuthoritativeInformation' Source
nonAuthoritativeInformation' :: forall b. Body b => Headers -> b -> ResponseM203 with headers
#nonAuthoritativeInformation Source
nonAuthoritativeInformation :: forall b. Body b => b -> ResponseM203
#noContent' Source
noContent' :: Headers -> ResponseM204 with headers
#networkAuthenticationRequired' Source
networkAuthenticationRequired' :: Headers -> ResponseM511 with headers
#multipleChoices' Source
multipleChoices' :: forall b. Body b => Headers -> b -> ResponseM300 with headers
#multipleChoices Source
multipleChoices :: forall b. Body b => b -> ResponseM300
#multiStatus Source
multiStatus :: forall b. Body b => b -> ResponseM207
#movedPermanently' Source
movedPermanently' :: forall b. Body b => Headers -> b -> ResponseM301 with headers
#movedPermanently Source
movedPermanently :: forall b. Body b => b -> ResponseM301
#misdirectedRequest' Source
misdirectedRequest' :: Headers -> ResponseM421 with headers
#misdirectedRequest Source
misdirectedRequest :: ResponseM421
#methodNotAllowed' Source
methodNotAllowed' :: Headers -> ResponseM405 with headers
#methodNotAllowed Source
methodNotAllowed :: ResponseM405
#loopDetected' Source
loopDetected' :: Headers -> ResponseM508 with headers
#loopDetected Source
loopDetected :: ResponseM508
#lengthRequired' Source
lengthRequired' :: Headers -> ResponseM411 with headers
#lengthRequired Source
lengthRequired :: ResponseM411
#internalServerError' Source
internalServerError' :: forall b. Body b => Headers -> b -> ResponseM500 with headers
#internalServerError Source
internalServerError :: forall b. Body b => b -> ResponseM500
#insufficientStorage' Source
insufficientStorage' :: Headers -> ResponseM507 with headers
#insufficientStorage Source
insufficientStorage :: ResponseM507
#imATeapot' Source
imATeapot' :: Headers -> ResponseM418 with headers
#hTTPVersionNotSupported' Source
hTTPVersionNotSupported' :: Headers -> ResponseM505 with headers
#gatewayTimeout' Source
gatewayTimeout' :: Headers -> ResponseM504 with headers
#gatewayTimeout Source
gatewayTimeout :: ResponseM504
#forbidden' Source
forbidden' :: Headers -> ResponseM403 with headers
#failedDependency' Source
failedDependency' :: Headers -> ResponseM424 with headers
#failedDependency Source
failedDependency :: ResponseM424
#expectationFailed' Source
expectationFailed' :: Headers -> ResponseM417 with headers
#expectationFailed Source
expectationFailed :: ResponseM417
#emptyResponse' Source
emptyResponse' :: Status -> Headers -> ResponseMThe same as emptyResponse but with headers.
#emptyResponse Source
emptyResponse :: Status -> ResponseMThe same as response but without a body.
#badRequest Source
badRequest :: forall b. Body b => b -> ResponseM400
#badGateway' Source
badGateway' :: Headers -> ResponseM502 with headers
#badGateway Source
badGateway :: ResponseM502
#alreadyReported' Source
alreadyReported' :: Headers -> ResponseM208 with headers
#alreadyReported Source
alreadyReported :: ResponseM208
Re-exports from HTTPure.Server
#serveSecure' Source
serveSecure' :: Options SSLOptions -> ListenOptions -> (Request -> ResponseM) -> Effect Unit -> ServerMGiven a Options HTTPS.SSLOptions object and a HTTP.ListenOptions
object, a function mapping Request to ResponseM, and a ServerM
containing effects to run on boot, creates and runs a HTTPure server with
SSL.
#serveSecure Source
serveSecure :: Int -> String -> String -> (Request -> ResponseM) -> Effect Unit -> ServerMCreate and start an SSL server. This method is the same as serve, but
takes additional SSL arguments. The arguments in order are:
- A port number
- A path to a cert file
- A path to a private key file
- A handler method which maps
RequesttoResponseM - A callback to call when the server is up
#serve Source
serve :: Int -> (Request -> ResponseM) -> Effect Unit -> ServerMCreate and start a server. This is the main entry point for HTTPure. Takes
a port number on which to listen, a function mapping Request to
ResponseM, and a ServerM containing effects to run after the server has
booted (usually logging). Returns an ServerM containing the server's
effects.
Given a string, return a
Maybecontaining the value of the matching header, if there is any.