Skip to content

Commit 627948c

Browse files
committed
Fill in missing BodyInit content types
1 parent 83eb7a6 commit 627948c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/ReludeFetch_Body.re

+12-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,22 @@ module Type = {
1818
module Content = {
1919
type t =
2020
| 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);
2226

2327
let toBodyInit: t => Fetch.bodyInit =
2428
fun
2529
| 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);
2737
};
2838

2939
// These are probably not really needed - the Body module exists in bs-fetch as a mechanism to include

0 commit comments

Comments
 (0)