How to make request body type compatible with RequestInit or BodyInit when using node-fetch?
I can think of two possible approaches - one is that setting the headers in a particular way to complement your body
type would resolve it.
The other thought is that an instance of a class may not be an appropriate body type. Can you stringify it?
Update: I had a weird error with RequestInit too, and it was resolved by specifying the type of the options (what you called 'params') object, like this:
let params: RequestInit = {
...
}
You need to stringify your body:
let params: RequestInit = {
headers: headers,
method: "PUT",
body: JSON.stringify(body)
}