Module

HTTPurple.Request

Package
purescript-httpurple
Repository
sigma-andex/purescript-httpurple

#ExtRequestNT Source

newtype ExtRequestNT :: Type -> Row Type -> Typenewtype ExtRequestNT route ext

Newtype wrapping an extended request For internal use only. Use ExtRequest instead.

Constructors

Instances

#ExtRequest Source

type ExtRequest :: Type -> Row Type -> Typetype ExtRequest route ext = Record (RequestR route ext)

Like Request, but can contain additional fields

#Request Source

type Request route = Record (RequestR route ())

The Request type is a Record type that includes fields for accessing the different parts of the HTTP request.

#RequestR Source

type RequestR :: Type -> Row Type -> Row Typetype RequestR route r = (body :: RequestBody, headers :: RequestHeaders, httpVersion :: Version, method :: Method, path :: Path, query :: Query, route :: route, url :: String | r)

#fromHTTPRequest Source

fromHTTPRequest :: forall route. RouteDuplex' route -> IncomingMessage IMServer -> Aff (Either (Request Unit) (Request route))

Given an HTTP Request object, this method will convert it to an HTTPurple Request object.

#fromHTTPRequestExt Source

fromHTTPRequestExt :: forall ctx ctxRL thru route. Union ctx thru ctx => Nub (RequestR route ctx) (RequestR route ctx) => RowToList ctx ctxRL => Keys ctx => RouteDuplex' route -> Proxy ctx -> IncomingMessage IMServer -> Aff (Either (Request Unit) (ExtRequestNT route ctx))

#fullPath Source

fullPath :: forall r. { path :: Path, query :: Query | r } -> String

Return the full resolved path, including query parameters. This may not match the requested path--for instance, if there are empty path segments in the request--but it is equivalent.