aboutsummaryrefslogtreecommitdiff
path: root/lib/s.ml
blob: 92259a050e0865620e272a03250f7a4da1e1dde9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
open Async
open Cohttp

module type Token = sig
    val token : string
end

module type Http = sig
    module Base : sig
        exception Invalid_Method

        val base_url : string

        val process_url : string -> Uri.t
        val process_request_body : Yojson.Basic.json -> Cohttp_async.Body.t
        val process_request_headers : unit -> Headers.t

        val process_response :
            Cohttp_async.Response.t * Cohttp_async.Body.t ->
            Yojson.Basic.json

        val request :
            ?body:Yojson.Basic.json ->
            [ `Delete | `Get | `Patch | `Post | `Put ] ->
            string ->
            Yojson.Basic.json Deferred.t
    end

    (* TODO add abstraction sigs *)
    val token : string
end