-
Hello, does node-fetch support customized content-type header for JSON body(e.g. application/vnd.xxx.v1+json)? Right now, when I try to test using that content-type, I get the following error: "Content type does not match response type, could not retrieve response object" node.js - 16.14.2 sample code: const credentials = Buffer.from(`${user}:${password}`).toString('base64');
const post_body = {"first_name": "John", "last_name": "Doe"}
const options = {
headers: {
Authorization: `Basic ${credentials}`,
Accept: "application/vnd.xxx.v1+json",
"Content-Type": "application/vnd.xxx.v1+json"
},
method: "POST",
uri: `${url}/names`,
timeout: 60,
body: JSON.stringify(post_body)
}; response returned is: status code: 400, response text: Bad Request |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sorry, this turns out an issue on my side. Custom content-type headers work as intended. Apologies. |
Beta Was this translation helpful? Give feedback.
Sorry, this turns out an issue on my side. Custom content-type headers work as intended. Apologies.