@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);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 4.0.1
    1
    • latest

Version History

Package Sidebar

Install

npm i @mesopo/http

Weekly Downloads

4

Version

4.0.1

License

ISC

Unpacked Size

322 kB

Total Files

13

Last publish

Collaborators

  • oolon