@mesopo/http

4.0.1 • Public • Published

simple http library for reason/ocaml

#example

let getUser =Http.get("https://api.example.com/user");


getUser @@ fun
  | Error(TimeOut) => Js.log("TIMEOUT")
  | Error(NetworkError) => 
    Js.log("NETWORK ERROR. Are you connected to the internet?")
  | Error(BadResponse(response)) => handleError(statusCode, body)
  | Ok(response) => userFetched(response.body |> parseUser);

/@mesopo/http/

    Package Sidebar

    Install

    npm i @mesopo/http

    Weekly Downloads

    1

    Version

    4.0.1

    License

    ISC

    Unpacked Size

    322 kB

    Total Files

    13

    Last publish

    Collaborators

    • oolon