Skip to content

Data corruption #4019

@xhyrom

Description

@xhyrom

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.
obrázok

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions