File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,22 @@ module Type = {
18
18
module Content = {
19
19
type t =
20
20
| String (string )
21
- | Json (Js . Json . t );
21
+ | Json (Js . Json . t )
22
+ | Blob (Fetch . blob )
23
+ | BufferSource (Fetch . bufferSource )
24
+ | FormData (Fetch . formData )
25
+ | UrlSearchParams (Fetch . urlSearchParams );
22
26
23
27
let toBodyInit : t => Fetch . bodyInit =
24
28
fun
25
29
| String (str ) => Fetch . BodyInit . make(str)
26
- | Json (json ) => Fetch . BodyInit . make(Js . Json . stringify(json));
30
+ | Json (json ) => Fetch . BodyInit . make(Js . Json . stringify(json))
31
+ | Blob (blob ) => Fetch . BodyInit . makeWithBlob(blob)
32
+ | BufferSource (bufferSource ) =>
33
+ Fetch . BodyInit . makeWithBufferSource(bufferSource)
34
+ | FormData (formData ) => Fetch . BodyInit . makeWithFormData(formData)
35
+ | UrlSearchParams (urlSearchParams ) =>
36
+ Fetch . BodyInit . makeWithUrlSearchParams(urlSearchParams);
27
37
};
28
38
29
39
// These are probably not really needed - the Body module exists in bs-fetch as a mechanism to include
You can’t perform that action at this time.
0 commit comments