HTTPure
- Package
- purescript-httpure
- Repository
- cprussin/purescript-httpure
Re-exports from HTTPure.Headers
#Headers Source
newtype Headers
The 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 String
The 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.Request
Re-exports from HTTPure.Response
#variantAlsoNegotiates' Source
variantAlsoNegotiates' :: Headers -> ResponseM
506 with headers
#upgradeRequired' Source
upgradeRequired' :: Headers -> ResponseM
426 with headers
#upgradeRequired Source
upgradeRequired :: ResponseM
426
#unsupportedMediaType' Source
unsupportedMediaType' :: Headers -> ResponseM
415 with headers
#unprocessableEntity' Source
unprocessableEntity' :: Headers -> ResponseM
422 with headers
#unprocessableEntity Source
unprocessableEntity :: ResponseM
422
#unauthorized' Source
unauthorized' :: Headers -> ResponseM
401 with headers
#unauthorized Source
unauthorized :: ResponseM
401
#uRITooLong' Source
uRITooLong' :: Headers -> ResponseM
414 with headers
#uRITooLong Source
uRITooLong :: ResponseM
414
#tooManyRequests' Source
tooManyRequests' :: Headers -> ResponseM
429 with headers
#tooManyRequests Source
tooManyRequests :: ResponseM
429
#temporaryRedirect Source
temporaryRedirect :: Body -> ResponseM
307
#switchingProtocols' Source
switchingProtocols' :: Headers -> ResponseM
101 with headers
#switchingProtocols Source
switchingProtocols :: ResponseM
101
#resetContent' Source
resetContent' :: Headers -> ResponseM
205 with headers
#resetContent Source
resetContent :: ResponseM
205
#requestTimeout' Source
requestTimeout' :: Headers -> ResponseM
408 with headers
#requestTimeout Source
requestTimeout :: ResponseM
408
#requestHeaderFieldsTooLarge' Source
requestHeaderFieldsTooLarge' :: Headers -> ResponseM
431 with headers
#rangeNotSatisfiable' Source
rangeNotSatisfiable' :: Headers -> ResponseM
416 with headers
#rangeNotSatisfiable Source
rangeNotSatisfiable :: ResponseM
416
#proxyAuthenticationRequired' Source
proxyAuthenticationRequired' :: Headers -> ResponseM
407 with headers
#processing' Source
processing' :: Headers -> ResponseM
102 with headers
#processing Source
processing :: ResponseM
102
#preconditionRequired' Source
preconditionRequired' :: Headers -> ResponseM
428 with headers
#preconditionFailed' Source
preconditionFailed' :: Headers -> ResponseM
412 with headers
#preconditionFailed Source
preconditionFailed :: ResponseM
412
#permanentRedirect Source
permanentRedirect :: Body -> ResponseM
308
#paymentRequired' Source
paymentRequired' :: Headers -> ResponseM
402 with headers
#paymentRequired Source
paymentRequired :: ResponseM
402
#payloadTooLarge' Source
payloadTooLarge' :: Headers -> ResponseM
413 with headers
#payloadTooLarge Source
payloadTooLarge :: ResponseM
413
#partialContent Source
partialContent :: Body -> ResponseM
206
#notModified' Source
notModified' :: Headers -> ResponseM
304 with headers
#notModified Source
notModified :: ResponseM
304
#notImplemented' Source
notImplemented' :: Headers -> ResponseM
501 with headers
#notImplemented Source
notImplemented :: ResponseM
501
#notExtended' Source
notExtended' :: Headers -> ResponseM
510 with headers
#notExtended Source
notExtended :: ResponseM
510
#notAcceptable' Source
notAcceptable' :: Headers -> ResponseM
406 with headers
#notAcceptable Source
notAcceptable :: ResponseM
406
#nonAuthoritativeInformation' Source
nonAuthoritativeInformation' :: Headers -> Body -> ResponseM
203 with headers
#nonAuthoritativeInformation Source
nonAuthoritativeInformation :: Body -> ResponseM
203
#noContent' Source
noContent' :: Headers -> ResponseM
204 with headers
#networkAuthenticationRequired' Source
networkAuthenticationRequired' :: Headers -> ResponseM
511 with headers
#multipleChoices Source
multipleChoices :: Body -> ResponseM
300
#multiStatus Source
multiStatus :: Body -> ResponseM
207
#movedPermanently Source
movedPermanently :: Body -> ResponseM
301
#misdirectedRequest' Source
misdirectedRequest' :: Headers -> ResponseM
421 with headers
#misdirectedRequest Source
misdirectedRequest :: ResponseM
421
#methodNotAllowed' Source
methodNotAllowed' :: Headers -> ResponseM
405 with headers
#methodNotAllowed Source
methodNotAllowed :: ResponseM
405
#loopDetected' Source
loopDetected' :: Headers -> ResponseM
508 with headers
#loopDetected Source
loopDetected :: ResponseM
508
#lengthRequired' Source
lengthRequired' :: Headers -> ResponseM
411 with headers
#lengthRequired Source
lengthRequired :: ResponseM
411
#internalServerError Source
internalServerError :: Body -> ResponseM
500
#insufficientStorage' Source
insufficientStorage' :: Headers -> ResponseM
507 with headers
#insufficientStorage Source
insufficientStorage :: ResponseM
507
#imATeapot' Source
imATeapot' :: Headers -> ResponseM
418 with headers
#hTTPVersionNotSupported' Source
hTTPVersionNotSupported' :: Headers -> ResponseM
505 with headers
#gatewayTimeout' Source
gatewayTimeout' :: Headers -> ResponseM
504 with headers
#gatewayTimeout Source
gatewayTimeout :: ResponseM
504
#forbidden' Source
forbidden' :: Headers -> ResponseM
403 with headers
#failedDependency' Source
failedDependency' :: Headers -> ResponseM
424 with headers
#failedDependency Source
failedDependency :: ResponseM
424
#expectationFailed' Source
expectationFailed' :: Headers -> ResponseM
417 with headers
#expectationFailed Source
expectationFailed :: ResponseM
417
#emptyResponse' Source
emptyResponse' :: Status -> Headers -> ResponseM
The same as emptyResponse
but with headers.
#emptyResponse Source
emptyResponse :: Status -> ResponseM
The same as response
but without a body.
#badRequest Source
badRequest :: Body -> ResponseM
400
#badGateway' Source
badGateway' :: Headers -> ResponseM
502 with headers
#badGateway Source
badGateway :: ResponseM
502
#alreadyReported' Source
alreadyReported' :: Headers -> ResponseM
208 with headers
#alreadyReported Source
alreadyReported :: ResponseM
208
Re-exports from HTTPure.Server
#serveSecure' Source
serveSecure' :: Options SSLOptions -> ListenOptions -> (Request -> ResponseM) -> ServerM -> ServerM
Given 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) -> ServerM -> ServerM
Create 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
Request
toResponseM
- A callback to call when the server is up
#serve Source
serve :: Int -> (Request -> ResponseM) -> ServerM -> ServerM
Create 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
Maybe
containing the value of the matching header, if there is any.