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 8669817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:34:03+00:00 2026-06-12T18:34:03+00:00

Currently trying to make an ajax post request to an IIS Express hosted MVC

  • 0

Currently trying to make an ajax post request to an IIS Express hosted MVC 4 Web API end point from an android VM (Bluestacks) on my machine. Here are the snippets of code that I am trying, and cannot get to work:

    $.ajax({
        type: "POST",
        url: "http://10.0.2.2:28434/api/devices",
        data: {'EncryptedPassword':'1234','UserName':'test','DeviceToken':'d234'}
    }).always(function( data, textStatus, jqXHR ) {
        alert( textStatus );
    });

Whenever I run this request I always get back a textStatus of ‘error’. After hours of trying different things, I pushed my End Point to an actual server, and was able to actually get responses back in PhoneGap if I built up an XMLHttpRequest by hand, like so:

var request = new XMLHttpRequest();
        request.open("POST", "http://172.16.100.42/MobileRewards/api/devices", true);
        request.onreadystatechange = function(){//Call a function when the state changes.
            console.log("state = " + request.readyState);
            console.log("status = " + request.status);
            if (request.readyState == 4) {
                if (request.status == 200 || request.status == 0) {
                    console.log("*" + request.responseText + "*");
                }
            }
        }
request.send("{EncryptedPassword:1234,UserName:test,DeviceToken:d234}");

Unfortunately, if I try to use $.ajax() against the same end point in the snippet above I still get a status text that says ‘error’, here is that snippet for reference:

    $.ajax({
        type: "POST",
        url: "http://172.16.100.42/MobileRewards/api/devices",
        data: {'EncryptedPassword':'1234','UserName':'test','DeviceToken':'d234'}
    }).always(function( data, textStatus, jqXHR ) {
        alert( textStatus );
    });

So really, there are a couple of questions here.

1) Why can’t I get any ajax calls (post or get) to successfully hit my End Point when it’s hosted via IIS Express on the same machine that the Android VM is running?

2) When my end point is hosted on an actual server, through IIS and served through port 80, why can’t I get post requests to be successful when I use jquery’s ajax calls? (Even though I can get it to work by manually creating an XMLHttpRequest)

Thanks

  • 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-06-12T18:34:04+00:00Added an answer on June 12, 2026 at 6:34 pm

    To anyone who ever looks this up, the issue ended up being the port that IIS Express was using on my local machine. When I got things to route through port 80, everything worked okay.

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

Sidebar

Related Questions

I am currently trying to make my Ajax to post some informations from a
I'm currently trying to make some ajax post between cross-domains by following this tutorial
I am currently trying to make a dropbox-esque application from a tutorial and I
I'm trying to make updates to a model using Ajax/POST. I'd like to be
I am trying to make a Ruby on Rails post via AJAX, and can't
Currently I'm trying to make an ajax entry delete function, when I click on
I am trying to send a post request through ajax to another domain and
Im trying to make a web chat using ajax control tool kit. There is
I'm trying to write an ajax POST to send a value from one ci
I'm currently trying to make a set of conversion functions which, through one call,

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.