OccultSlolem
OccultSlolem2y ago

Read the body of a POST Request

Hey, is it possible to read the body of a POST request in an HTML endpoint?
No description
5 Replies
ari
ari2y ago
You should be able to view the body by calling .json() instead of .body()
OccultSlolem
OccultSlolemOP2y ago
👍
ari
ari2y ago
Assuming your body is json! I think there are other methods too, like for array buffers
OccultSlolem
OccultSlolemOP2y ago
Yeah, I was trying to parse it using a TextDecoder and that's where I got the issue
sshader
sshader2y ago
request.arrayBuffer() should give you something you can feed into TextDecoder?

Did you find this page helpful?