Open tom-sherman opened 2 years ago
That headers change is the first thing I did in #30 😂 https://github.com/tinymce/rescript-webapi/compare/fetch-newapi
Supplying a Request.t
to fetch
also makes sense, similar to how I changed the headers, forcing use of the init
object doesn't make a lot of sense to me.
I'm not sure about how this would be done but it would be great if I could pass
Headers.t
toRequestInit.make
andRequest.t
tofetch
.This is possible in the fetch API but not possible in the bindings right now.
My current workaround is to have a couple of cast functions. This function is safe for
Request
as it extendsRequestInit
so it's safe to downcast it, it's unsafe for Headers though except for the fetch API.