Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.21.2 has a breaking change with pre-stringified JSON request body #4017

Closed
kawanet opened this issue Sep 5, 2021 · 2 comments
Closed

0.21.2 has a breaking change with pre-stringified JSON request body #4017

kawanet opened this issue Sep 5, 2021 · 2 comments

Comments

@kawanet
Copy link

kawanet commented Sep 5, 2021

Describe the bug

Since commit 5ad6994 in PR #3688 released with axios version 0.21.2,
it has a breaking change which forces to stringify the body even when pre-stringified in app.

To Reproduce

const axios = require("axios");
const body = "{}"; // pre-stringified JSON
const options = {headers: {"content-type": "application/json"}};
axios.post("http://127.0.0.1:3000/", body, options);
  • With 0.21.1, it sends a 2 byte request body {} to the server.
  • With 0.21.2, it sends a 4 byte request body "{}" to the server.

My app have a big post data which is already built by my app.
Axios should just send the body content pass through to the server.

Expected behavior

  • keep 0.21.1's behavior

Environment

  • Axios Version 0.21.1 and 0.21.2
  • Node.js Version 14.17.0
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2021

Hello! 👋

This issue is being automatically closed because it does not follow the issue template. Please read the issue template carefully and follow all of the instructions when opening a new issue.

Thanks

@github-actions github-actions bot closed this as completed Sep 5, 2021
@kawanet
Copy link
Author

kawanet commented Sep 5, 2021

thanks bot. #4018 just copied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant