SentiaAnalytics / bs-sentia-http

http lib for reasonml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

http lib for reasonml


Languages

Language:JavaScript 98.0%Language:OCaml 1.9%Language:HTML 0.1%