HTTPure
- Package
 - purescript-httpure
 - Repository
 - citizennet/purescript-httpure
 
Re-exports from HTTPure.Body 
#toString Source
toString :: RequestBody -> Aff StringTurn RequestBody into a String
This drains the Readable stream in RequestBody for the first time
and returns cached result from then on.
#toStream Source
toStream :: RequestBody -> Readable ()Return the Readable stream directly from RequestBody
#toBuffer Source
toBuffer :: RequestBody -> Aff BufferTurn RequestBody into a Buffer
This drains the Readable stream in RequestBody for the first time
and returns cached result from then on.
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.MultiHeaders 
#MultiHeaders Source
newtype MultiHeadersThe MultiHeaders type represets the set of headers in a HTTP request or
response read in a way such that every header name maps to a non-empty list
of header values. This is useful for headers that may have multiple values,
such as "Set-Cookie".
Instances
Newtype MultiHeaders _Generic MultiHeaders _Lookup MultiHeaders String (NonEmptyArray String)Given a string, return a
Maybecontaining the values of the matching header, if there is any.Show MultiHeadersEq MultiHeadersCompare two
MultiHeadersobjects by comparing the underlyingObjects.Semigroup MultiHeadersAllow one
MultiHeadersobjects to be appended to another.Monoid MultiHeaders
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 
#Request Source
type Request = { body :: RequestBody, headers :: Headers, httpVersion :: Version, method :: Method, multiHeaders :: MultiHeaders, path :: Path, query :: Query, url :: String }The Request type is a Record type that includes fields for accessing
the different parts of the HTTP request.
Re-exports from HTTPure.Response 
#variantAlsoNegotiates' Source
variantAlsoNegotiates' :: forall m. MonadAff m => Headers -> m Response506 with headers
#variantAlsoNegotiates Source
variantAlsoNegotiates :: forall m. MonadAff m => m Response506
#upgradeRequired' Source
upgradeRequired' :: forall m. MonadAff m => Headers -> m Response426 with headers
#upgradeRequired Source
upgradeRequired :: forall m. MonadAff m => m Response426
#unsupportedMediaType' Source
unsupportedMediaType' :: forall m. MonadAff m => Headers -> m Response415 with headers
#unsupportedMediaType Source
unsupportedMediaType :: forall m. MonadAff m => m Response415
#unprocessableEntity' Source
unprocessableEntity' :: forall m. MonadAff m => Headers -> m Response422 with headers
#unprocessableEntity Source
unprocessableEntity :: forall m. MonadAff m => m Response422
#unauthorized Source
unauthorized :: forall m. MonadAff m => m Response401
#uRITooLong Source
uRITooLong :: forall m. MonadAff m => m Response414
#tooManyRequests' Source
tooManyRequests' :: forall m. MonadAff m => Headers -> m Response429 with headers
#tooManyRequests Source
tooManyRequests :: forall m. MonadAff m => m Response429
#temporaryRedirect' Source
temporaryRedirect' :: forall m b. MonadAff m => Body b => Headers -> b -> m Response307 with headers
#temporaryRedirect Source
temporaryRedirect :: forall m b. MonadAff m => Body b => b -> m Response307
#switchingProtocols' Source
switchingProtocols' :: forall m. MonadAff m => Headers -> m Response101 with headers
#switchingProtocols Source
switchingProtocols :: forall m. MonadAff m => m Response101
#resetContent Source
resetContent :: forall m. MonadAff m => m Response205
#requestTimeout' Source
requestTimeout' :: forall m. MonadAff m => Headers -> m Response408 with headers
#requestTimeout Source
requestTimeout :: forall m. MonadAff m => m Response408
#requestHeaderFieldsTooLarge' Source
requestHeaderFieldsTooLarge' :: forall m. MonadAff m => Headers -> m Response431 with headers
#requestHeaderFieldsTooLarge Source
requestHeaderFieldsTooLarge :: forall m. MonadAff m => m Response431
#rangeNotSatisfiable' Source
rangeNotSatisfiable' :: forall m. MonadAff m => Headers -> m Response416 with headers
#rangeNotSatisfiable Source
rangeNotSatisfiable :: forall m. MonadAff m => m Response416
#proxyAuthenticationRequired' Source
proxyAuthenticationRequired' :: forall m. MonadAff m => Headers -> m Response407 with headers
#proxyAuthenticationRequired Source
proxyAuthenticationRequired :: forall m. MonadAff m => m Response407
#processing Source
processing :: forall m. MonadAff m => m Response102
#preconditionRequired' Source
preconditionRequired' :: forall m. MonadAff m => Headers -> m Response428 with headers
#preconditionRequired Source
preconditionRequired :: forall m. MonadAff m => m Response428
#preconditionFailed' Source
preconditionFailed' :: forall m. MonadAff m => Headers -> m Response412 with headers
#preconditionFailed Source
preconditionFailed :: forall m. MonadAff m => m Response412
#permanentRedirect' Source
permanentRedirect' :: forall m b. MonadAff m => Body b => Headers -> b -> m Response308 with headers
#permanentRedirect Source
permanentRedirect :: forall m b. MonadAff m => Body b => b -> m Response308
#paymentRequired' Source
paymentRequired' :: forall m. MonadAff m => Headers -> m Response402 with headers
#paymentRequired Source
paymentRequired :: forall m. MonadAff m => m Response402
#payloadTooLarge' Source
payloadTooLarge' :: forall m. MonadAff m => Headers -> m Response413 with headers
#payloadTooLarge Source
payloadTooLarge :: forall m. MonadAff m => m Response413
#partialContent' Source
partialContent' :: forall m b. MonadAff m => Body b => Headers -> b -> m Response206 with headers
#notModified Source
notModified :: forall m. MonadAff m => m Response304
#notImplemented' Source
notImplemented' :: forall m. MonadAff m => Headers -> m Response501 with headers
#notImplemented Source
notImplemented :: forall m. MonadAff m => m Response501
#notExtended Source
notExtended :: forall m. MonadAff m => m Response510
#notAcceptable' Source
notAcceptable' :: forall m. MonadAff m => Headers -> m Response406 with headers
#notAcceptable Source
notAcceptable :: forall m. MonadAff m => m Response406
#nonAuthoritativeInformation' Source
nonAuthoritativeInformation' :: forall m b. MonadAff m => Body b => Headers -> b -> m Response203 with headers
#nonAuthoritativeInformation Source
nonAuthoritativeInformation :: forall m b. MonadAff m => Body b => b -> m Response203
#networkAuthenticationRequired' Source
networkAuthenticationRequired' :: forall m. MonadAff m => Headers -> m Response511 with headers
#networkAuthenticationRequired Source
networkAuthenticationRequired :: forall m. MonadAff m => m Response511
#multipleChoices' Source
multipleChoices' :: forall m b. MonadAff m => Body b => Headers -> b -> m Response300 with headers
#multiStatus' Source
multiStatus' :: forall m b. MonadAff m => Body b => Headers -> b -> m Response207 with headers
#movedPermanently' Source
movedPermanently' :: forall m b. MonadAff m => Body b => Headers -> b -> m Response301 with headers
#misdirectedRequest' Source
misdirectedRequest' :: forall m. MonadAff m => Headers -> m Response421 with headers
#misdirectedRequest Source
misdirectedRequest :: forall m. MonadAff m => m Response421
#methodNotAllowed' Source
methodNotAllowed' :: forall m. MonadAff m => Headers -> m Response405 with headers
#methodNotAllowed Source
methodNotAllowed :: forall m. MonadAff m => m Response405
#loopDetected Source
loopDetected :: forall m. MonadAff m => m Response508
#lengthRequired' Source
lengthRequired' :: forall m. MonadAff m => Headers -> m Response411 with headers
#lengthRequired Source
lengthRequired :: forall m. MonadAff m => m Response411
#internalServerError' Source
internalServerError' :: forall m b. MonadAff m => Body b => Headers -> b -> m Response500 with headers
#internalServerError Source
internalServerError :: forall m b. MonadAff m => Body b => b -> m Response500
#insufficientStorage' Source
insufficientStorage' :: forall m. MonadAff m => Headers -> m Response507 with headers
#insufficientStorage Source
insufficientStorage :: forall m. MonadAff m => m Response507
#hTTPVersionNotSupported' Source
hTTPVersionNotSupported' :: forall m. MonadAff m => Headers -> m Response505 with headers
#hTTPVersionNotSupported Source
hTTPVersionNotSupported :: forall m. MonadAff m => m Response505
#gatewayTimeout' Source
gatewayTimeout' :: forall m. MonadAff m => Headers -> m Response504 with headers
#gatewayTimeout Source
gatewayTimeout :: forall m. MonadAff m => m Response504
#failedDependency' Source
failedDependency' :: forall m. MonadAff m => Headers -> m Response424 with headers
#failedDependency Source
failedDependency :: forall m. MonadAff m => m Response424
#expectationFailed' Source
expectationFailed' :: forall m. MonadAff m => Headers -> m Response417 with headers
#expectationFailed Source
expectationFailed :: forall m. MonadAff m => m Response417
#emptyResponse' Source
emptyResponse' :: forall m. MonadAff m => Status -> Headers -> m ResponseThe same as emptyResponse but with headers.
#emptyResponse Source
emptyResponse :: forall m. MonadAff m => Status -> m ResponseThe same as response but without a body.
#badRequest' Source
badRequest' :: forall m b. MonadAff m => Body b => Headers -> b -> m Response400 with headers
#badGateway Source
badGateway :: forall m. MonadAff m => m Response502
#alreadyReported' Source
alreadyReported' :: forall m. MonadAff m => Headers -> m Response208 with headers
#alreadyReported Source
alreadyReported :: forall m. MonadAff m => m Response208
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.