aboutsummaryrefslogtreecommitdiff
path: root/lib/http.ml
diff options
context:
space:
mode:
authorAdelyn Breelove <[email protected]>2019-01-10 13:12:49 -0700
committerAdelyn Breelove <[email protected]>2019-01-10 13:12:49 -0700
commitb9ee77f8153090e9d47e73ab195540d10720c7b6 (patch)
treed36bdb7ce17e03ee1bdb60d6b638f8ac6e022711 /lib/http.ml
parentWhy are events so confusing (diff)
downloaddisml-b9ee77f8153090e9d47e73ab195540d10720c7b6.tar.xz
disml-b9ee77f8153090e9d47e73ab195540d10720c7b6.zip
AAAAAAAAAAAAAAAAAAAAAAAA
Diffstat (limited to 'lib/http.ml')
-rw-r--r--lib/http.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/http.ml b/lib/http.ml
index f04a49f..9ef9334 100644
--- a/lib/http.ml
+++ b/lib/http.ml
@@ -2,7 +2,8 @@ module Make(T : S.Token) = struct
open Core
open Async
open Cohttp
- include T
+
+ let token = T.token
module Base = struct
exception Invalid_Method
@@ -35,12 +36,11 @@ module Make(T : S.Token) = struct
| None -> raise Bad_response_headers)
>>= fun () ->
match resp |> Response.status |> Code.code_of_status with
- | 200 -> body |> Cohttp_async.Body.to_string >>= Deferred.Or_error.return
+ | 200 -> body |> Cohttp_async.Body.to_string >>| Yojson.Safe.from_string >>= Deferred.Or_error.return
| code ->
body |> Cohttp_async.Body.to_string >>= fun body ->
Deferred.Or_error.errorf "Unsuccessful response received: %d - %s" code body
-
let request ?(body=`Null) m path =
rl := Rl.update ~f:(function
| None ->