Closed
Description
I tried to follow the doc example to patch
to my rails server:
const response = await patch('localhost:3000/my_endpoint', { body: { name: 'Request.JS' }})
but noticed that [object Object]
was being sent as the body. Looking at samples on https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch, I updated my code to stringify the JSON payload first.
const response = await patch('localhost:3000/my_endpoint', { body: JSON.stringify({ name: 'Request.JS' })})
Is this expected or did I miss something? Should the library do this for us? Maybe when the detected content type is application/json
(
request.js/src/fetch_request.js
Line 73 in 0eda429
body
?Metadata
Metadata
Assignees
Labels
No labels