Error response data nodejs
Problem
Describe the bug ` var axios = require('axios'); var data = JSON.stringify({ "production_status": "", "package_status": [], "extra_status_reason": [], "page": 1, "limit": 1 }); var config = { method: 'post', url: 'https://example.com/', headers: { 'Authorization': 'Bearer token', }, data: { "production_status": "", "package_status": [], "extra_status_reason": [], "page": 1, "limit": 1 } }; axios(config) .then(function (response) { console.log(response.data); }) .catch(function (error) { console.log(error); }); ` When i send API this response I want respose must be json like that To Reproduce _No response_ Code snippet _No response_ Expected behavior _No response_ Axios Version 1.2.0 Adapter Version _No response_ Browser _No response_ Browser Version _No response_ Node.js Version 14.20.1 OS _No response_ Additional Library Versions _No response_ Additional context/Screenshots _No response_
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Error response data nodejs
Indeed, that workaround works in my case... based upon https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding I select `identity`: [code block]
Trust Score
8 verifications
- 1
Indeed, that workaround works in my case... based upon https://developer.mozilla
Indeed, that workaround works in my case... based upon https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding I select `identity`:
Validation
Resolved in axios/axios GitHub issue #5298. Community reactions: 46 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep