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

Readme

Keywords

none

Package Sidebar

Install

npm i @mesopo/http

Weekly Downloads

0

Version

4.0.1

License

ISC

Unpacked Size

322 kB

Total Files

13

Last publish

Collaborators

  • oolon