From b9ee77f8153090e9d47e73ab195540d10720c7b6 Mon Sep 17 00:00:00 2001 From: Adelyn Breelove Date: Thu, 10 Jan 2019 13:12:49 -0700 Subject: AAAAAAAAAAAAAAAAAAAAAAAA --- lib/http.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/http.ml') 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 -> -- cgit v1.2.3