-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Data corruption #4019
Copy link
Copy link
Closed
Description
Describe the bug
The data should always be json, but in this case it's corrupted and there are invalid characters.
To Reproduce
Code snippet to reproduce, ideally that will work by pasting into something like https://npm.runkit.com/axios, a hosted solution, or a repository that illustrates the issue. If your problem is not reproducible, please file under Support or Usage Question
let test = await axios({
url: new URL('https://discord.com/api/v9/users/@me').toString(),
responseType: 'json',
responseEncoding: 'utf8',
method: "PATCH",
headers: {
...getIdentifiers(),
"Authorization": `${x}`
},
data: {
bio: date
}
})
console.log(test.data)Expected behavior
It was supposed to return json to me, as node-fetch only node-fetch uses ESM, so I can't use it and it doesn't have PATCH request support.
Environment
- Axios Version 0.21.3
- Adapter HTTP
- Browser [Firefox
- Browser Version Latest
- Node.js Version 16.6.2
- OS: Windows 11
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels