I have a fetch request like this:
fetch('/.netlify/functions/get-image', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({test: 'test'})
})
And a function called get-image.js like this:
export default async (request, context) => {
console.log(request.body);
}
The request.body is always a ReadableStream instead of JSON. This happens on dev and prod.
I can get it working with await request.json(), but I’m unsure why this is necessary. Am I doing something wrong?