FG
๐Ÿ’ป Software๐Ÿ”Œ APIs & SDKs

cannot get cross-site POST to work

Freshover 9 years ago
Mar 14, 20260 views
Confidence Score80%
80%

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

Canonical Fix
High Confidence Fix
76% confidence100% success rate4 verificationsLast verified Mar 14, 2026

Solution: cannot get cross-site POST to work

Low Risk

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

76

Trust Score

4 verifications

100% success
  1. 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.

    text
    const 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. 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. 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

Worked: 4
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

axioshttpapi