Unable to get body in PUT request (works in POST)
Sample code:
I'm unable to identify why
PUT
does not give me any body while POST
does work perfectly fine. For PUT request.body is always null
EVEN if it contains body.
Yes I know that the code above does not make much sense but it's only an example.6 Replies
Is it some known bug / limitation of workers or what? Why does it work perfectly ok with POST but not with PUT requests?
Have you tried cloning the
Request
body? Since you can't pass it on to your fetch
call if you already consumed it with request.text()
. Here's an example that works.Its opposite actually:) the request.text() is empty here.
Like this?
I'm getting a 404, but that appears to be coming from your origin
Hmm I'll check later... Weird...
Thanks
Casue for me it was empty on await req.text() while it was reaching its origin fine....