Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing Headers.t to RequestInit.make and Request.t to fetch #70

Open
tom-sherman opened this issue Dec 24, 2021 · 1 comment
Open

Passing Headers.t to RequestInit.make and Request.t to fetch #70

tom-sherman opened this issue Dec 24, 2021 · 1 comment

Comments

@tom-sherman
Copy link
Contributor

tom-sherman commented Dec 24, 2021

I'm not sure about how this would be done but it would be great if I could pass Headers.t to RequestInit.make and Request.t to fetch.

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 extends RequestInit so it's safe to downcast it, it's unsafe for Headers though except for the fetch API.

@TheSpyder
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants