Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7180975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:27:38+00:00 2026-05-28T17:27:38+00:00

I need to make an ajax POST request (json) to a different domain (later

  • 0

I need to make an ajax POST request (json) to a different domain (later everything will be in the same domain, but I’m testing in localhost and don’t have access to the server yet).

Note: Currently there’s not possible to make modifications in the server’s code.

I found few solutions for this problem:

jsonp: Doesn’t work

CORS plugin for firefox (to force allowing different domains): Would work if I send POST request, but JQuery itself is making first OPTIONS request (because it detects different domains, probably). And here I have a problem, because the server needs authentication (for everything, including OPTIONS).

I am sending the authentication in the header of the POST request, but JQuery is not including this in the header of the OPTIONS request, and since it’s being done “in the background”, I can’t add it.

Actually there could be 2 solutions:

  1. Add authentication header to the OPTIONS request. But as mentioned I’m not sending this request myself, so I don’t know where/how to do it.

  2. Force JQuery to not make that OPTIONS request, but send POST directly (which is the title of this thread). I searched a while but didn’t find anything. Is that possible?

I’m using JQuery 1.7.1 and $.ajax({…}) to make the request.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:27:39+00:00Added an answer on May 28, 2026 at 5:27 pm

    This is a tricky one. I suggest doing the following.

    Make a ajax-connection a file on the same domain. Do a cURL-connection to the file located somewhere else.

    Send post-information and add authentication headers too.

    You can see here for the last part: http://php.bigresource.com/CURL-and-HTTP-Authentication–p8WkKqkq.html

    Simply googling “post headers curl” should help you with that part.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to make an Ajax request, but its response may vary and it's
I need to make a jsonp POST request with the content type 'application/json'. I
I need to make an AJAX request from a website to a REST web
I need to make a request to an API which returns json formatted data.
So I need to make a a cross domain request where the response is
I need to make an AJAX request to some script from the onSave event
I need to make a synchronous request to the last.fm API, but when I
I'm trying to make a POST request to my Sinatra app, but I'm having
i need a tips, how to make a AJAX request with mootools, when some
I need to send an ajax POST request to my server. I'll need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.