weixin_33701294 2015-12-03 01:26 采纳率: 0%
浏览 61

AngularJS $ .ajax问题

XMLHttpRequest cannot load http://192.168.1.134:8888/pivot/api/report/uploadReport. Response for preflight has invalid HTTP status code 404

I am getting this error. Is anyone has an idea?

var settings = {
    "async": true,
    "crossDomain": true,
    "url": baseURL + "report/uploadReport",
    "method": "POST",
    "headers": {
        "token": window.localStorage['token']
    },
    "data": {
        "rating": rating,
        "desc": desc,
        "spot_id": window.localStorage['spotId'],
        "image_name": path
    }
};

console.log(settings);
$.ajax(settings).done(
    function(response) {
        console.log(response);
    }
);

This is code part to call ajax. Thanks

  • 写回答

1条回答 默认 最新

  • weixin_33738578 2015-12-03 02:19
    关注

    Response for preflight has invalid HTTP status code 404

    404 means the server could not find the request resource. You're hitting a URL without a defined route. You'll need to tell your server what to respond with for that route.

    评论

报告相同问题?