Closed brc-dd closed 2 months ago
Name | Link |
---|---|
Latest commit | be296dc08383dd1b82e6e15581917bf137e7c7c6 |
Latest deploy log | https://app.netlify.com/sites/sefirot-story/deploys/663945d14c73770008665251 |
Deploy Preview | https://deploy-preview-522--sefirot-story.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Name | Link |
---|---|
Latest commit | be296dc08383dd1b82e6e15581917bf137e7c7c6 |
Latest deploy log | https://app.netlify.com/sites/sefirot-docs/deploys/663945d14c73770008665253 |
Deploy Preview | https://deploy-preview-522--sefirot-docs.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Ahah. OK let me know if I'm understanding the code here.
So, when we use post
method and pass in FormData (usually containing file), then it will create this stringified json data. And When upload
is used, it will append non binary data just as key-value to the formdata...?
upload
is not changed. upload
is called with body like { foo: File, bar: 1 }
, then corresponding form data will have foo = File
and bar = '1'
and will be sent using POST request.
If post
is called with body like { foo: File, bar: 1 }
, then corresponding form data will have foo = File
and __payload__ = '{"bar":1}'
and will be sent using POST request.
If post
is called with body not containing any File
, then normal JSON POST request will be sent instead of multipart one. (same as earlier)
upload
is effectively redundant after this PR if the backend has the middleware to parse __payload__
Gotcha! Make sense 👍
don't merge yet, I'll test it out first
TODO