Module
HTTPure
- Package
- purescript-httpure
- Repository
- cprussin/purescript-httpure
Re-exports from HTTPure.Headers
Re-exports from HTTPure.Request
Re-exports from HTTPure.Response
#Response Source
data ResponseA response is a status and headers, and for some statuses, a body. You can
use the data constructor Response to send non-standard status codes.
Constructors
Response Int Headers BodyContinue HeadersSwitchingProtocols HeadersProcessing HeadersOK Headers BodyCreated HeadersAccepted HeadersNonAuthoritativeInformation Headers BodyNoContent HeadersResetContent HeadersPartialContent Headers BodyMultiStatus Headers BodyAlreadyReported HeadersIMUsed Headers BodyMultipleChoices Headers BodyMovedPermanently Headers BodyFound Headers BodySeeOther Headers BodyNotModified HeadersUseProxy Headers BodyTemporaryRedirect Headers BodyPermanentRedirect Headers BodyBadRequest Headers BodyPaymentRequired HeadersForbidden HeadersNotFound HeadersMethodNotAllowed HeadersNotAcceptable HeadersProxyAuthenticationRequired HeadersRequestTimeout HeadersConflict Headers BodyGone HeadersLengthRequired HeadersPreconditionFailed HeadersPayloadTooLarge HeadersURITooLong HeadersUnsupportedMediaType HeadersRangeNotSatisfiable HeadersExpectationFailed HeadersImATeapot HeadersMisdirectedRequest HeadersUnprocessableEntity HeadersLocked HeadersFailedDependency HeadersUpgradeRequired HeadersPreconditionRequired HeadersTooManyRequests HeadersRequestHeaderFieldsTooLarge HeadersInternalServerError Headers BodyNotImplemented HeadersBadGateway HeadersGatewayTimeout HeadersHTTPVersionNotSupported HeadersVariantAlsoNegotiates HeadersInsufficientStorage HeadersLoopDetected HeadersNotExtended HeadersNetworkAuthenticationRequired Headers
Re-exports from HTTPure.Server
#SecureServerM Source
type SecureServerM e = ServerM (fs :: FS | e)The SecureServerM type is the same as the ServerM type, but it includes effects for working with the filesystem (to load the key and certificate).
#serve' Source
serve' :: forall e. Int -> String -> String -> (Request -> ResponseM (fs :: FS | e)) -> SecureServerM e -> SecureServerM eCreate 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 to ResponseM
- A callback to call when the server is up
#serve Source
serve :: forall e. Int -> (Request -> ResponseM e) -> ServerM e -> ServerM eCreate 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 an HTTPureM containing effects to run after the server has booted (usually logging). Returns an HTTPureM containing the server's effects.
When using show on a Request, print the method and the path.