-
-
Notifications
You must be signed in to change notification settings - Fork 362
-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
Sending form data fails on Deno 1.13.2 #380
Comments
I am able to reproduce. I bisected the Deno version and found that Deno 1.12.0 is where it breaks. The error message points to this line in Deno's code: So I guess the request URL is being turned into a Blob URL somehow? Not sure why that would be happening. We're certainly not doing that intentionally and given that we're not having this problem in other environments or on older versions of Deno, I'm inclined to say this should be reported to the Deno team as a regression. But it's possible we're doing something funky - needs more investigation. Repro code: import ky from 'https://cdn.skypack.dev/ky?dts'
const url = 'https://httpbin.org/anything';
const body = new FormData();
body.append('username', 'janedoe');
// const response = await fetch(url, { method : 'POST', body });
const response = await ky.post(url, { body });
console.log('response:', response);
console.log('form:', (await response.json()).form); |
I found that wrapping the form data in a const url = 'https://example.com';
const formData = new FormData();
formData.append('username', 'test');
r = await ky.post(url, { body: new URLSearchParams(formData) }); |
It's caused by denoland/deno#16570 , Line 298 in 577dd4c
|
Is this still happening with latest Ky and Deno? #435 may improve the situation, at least for requests that aren't retried. |
Hi.
I get an error when I send form data using
ky.post
method onDeno 1.13.2
.Error message is below:
It is no problem on
Deno 1.11.5
.But on
Deno 1.13.2
, it fails.Even though raw
fetch
(globalThis.fetch
) succeeds.ky.post
withjson
also succeeds.There may be some discrepancies between what your library expects and the latest Deno implementation.
I tried using a Deno Docker container.
The command used is:
This is my sample code:
results:
The text was updated successfully, but these errors were encountered: