std.http.types

Types

type Method = String

type Failure = 
    | DontProcess
    | Error String

Type used by handlers to indicate why they could not process a request

type Request = { method : String, uri : Uri, body : Body }

type StatusCode = Int

type Headers = Array (String, Array Byte)

type Response = { status : Int, headers : Array (String, Array Byte) }

type ResponseBody = <opaque>

type HttpEffect r a = [| alt : Alt, state : State HttpState, lift : Lift IO | r |] a

type HttpState = {
    request : { method : String, uri : Uri, body : Body },
    response : ResponseBody
}

type Uri = <opaque>