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

Implement formdata as body #4363

Merged
merged 11 commits into from
Mar 17, 2020
Merged

Conversation

crowlKats
Copy link
Member

@crowlKats crowlKats commented Mar 14, 2020

This resolves #4327
I have not made a unit test for it as i am unsure how the system works with servers

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - but I think we should get a basic unit test for this feature. You can look in https://github.com/denoland/deno/blob/master/cli/js/tests/fetch_test.ts for examples of other tests.

@crowlKats
Copy link
Member Author

crowlKats commented Mar 14, 2020

I created the test, tho, it isnt the best as i wanted to test the ability of files, but that is not possible as i found no way to read content from a DomFile (or rather, Blob, as DomFile extends Blob) except the Blob methods stream, text & arrayBuffer, which currently are not implemented, as they are based on readable stream, as written in the spec just noticed the streams folder, i guess i will take a look at it and see if i manage to implement those methods

const resultForm = await response.formData();
assertEquals(form.get("field"), resultForm.get("field"));
}
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works for me - thanks!

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ry ry merged commit 9833975 into denoland:master Mar 17, 2020
@crowlKats crowlKats deleted the implement_formdata_as_body branch March 17, 2020 07:06
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

Successfully merging this pull request may close these issues.

Using FormData in body of Fetch API is not implemented
2 participants