Skip to content

Commit 3c7d965

Browse files
committed
Expose Http.Encoder constructor
1 parent 431eda2 commit 3c7d965

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/helix/Helix.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ module Http : sig
141141
module Encoder : sig
142142
type 'a t
143143

144+
val make : ?content_type:string -> ('a -> Stdweb.Fetch.Body.t) -> 'a t
144145
val empty : unit t
145146
val text : string t
146147
val form_data : Stdweb.Form_data.t t

src/helix/Http.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ type body = Stdweb.Fetch.Body.t
2020
module Encoder = struct
2121
type 'a t = string option * ('a -> Fetch.Body.t)
2222

23+
let make ?(content_type) f = content_type, f
24+
2325
let to_undefined_body _ = Fetch.Body.unsafe_of_js Jx.undefined
2426
let empty = (None, to_undefined_body)
2527
let ignore = (None, to_undefined_body)

0 commit comments

Comments
 (0)