cannot get cross-site POST to work
Problem
Hello, Thanks for the great work. Although that were some releases targeting cross-site requests, I still can't get it to work. I dug through the previous posts and tried adding: - crossDomain: true - xDomain: true *xDomainRequest: true to the config. And none of them worked. (If this feature is actually available, updating the readme would help.) Please advise ASAP. Thank you.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: cannot get cross-site POST to work
I just ran into this issue as well and it only seems to happen for me on Mac. I spent a good 3 days and nights trying to debug my network and decided on a whim to try this using a vanilla XHR request and realized the problem wasn't my network, but axios. I too am doing cross-site requests with credentials set to true. Looking at the network request, you get an ERR_EMPTY_RESPONSE and it's like the
Trust Score
4 verifications
- 1
I just ran into this issue as well and it only seems to happen for me on Mac. I
I just ran into this issue as well and it only seems to happen for me on Mac. I spent a good 3 days and nights trying to debug my network and decided on a whim to try this using a vanilla XHR request and realized the problem wasn't my network, but axios.
textconst myApi = axios.create({ baseURL: 'http://someUrl/someEndpoint', timeout: 10000, withCredentials: true, transformRequest: [(data) => JSON.stringify(data.data)], headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', } });' - 2
I too am doing cross-site requests with credentials set to true. Looking at the
I too am doing cross-site requests with credentials set to true. Looking at the network request, you get an ERR_EMPTY_RESPONSE and it's like the request failed before it even left the browser.
- 3
If I get a chance I will try to look into this further.
If I get a chance I will try to look into this further.
Validation
Resolved in axios/axios GitHub issue #191. Community reactions: 6 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep