kwhitley / itty-fetcher

An even simpler wrapper around native Fetch to strip boilerplate from your fetching code!
MIT License
98 stars 4 forks source link

FormData handling #10

Closed danawoodman closed 2 years ago

danawoodman commented 2 years ago

I believe right now sending FormData is broken as we are always stringifying the payload.

I believe we want to check if the payload is FormData and if so, pass it as-is:

payload: payload instanceof FormData ? payload : JSON.stringify(payload)

We should add tests to assert this expected behavior.

This is a placeholder for that work.

kwhitley commented 2 years ago

Agreed... def one of the things we need to support!

danawoodman commented 2 years ago

I've got this working locally, just updating/refactoring tests before I put up a PR