weixin_33736832 2016-08-03 13:35 采纳率: 0%
浏览 91

回调HTTP 400错误

I try post data with REST API using jQuery AJAX. My code is below,

$.ajax({
    url: 'myurl',
    type: 'POST',
    contentType: 'application/json; charset=utf-8',
    data: JSON.stringify(jsonData),
    dataType: 'jsonp',
    success: function(responseData, textStatus, jqXHR) {   
        if (responseData.result == "true") {            
            $.mobile.changePage("#registersuccess",{transition:"slide"});
        } else {
            alert("kayıt başarısız");
        }
    }
});

I am monitoring with Explorer developer tools. I get this error message:

HTTP400: BAD REQUEST - The request could not be processed by the server due to invalid syntax.
GET - http:MyService?callback=jQuery111306711937631005869_1470230696599&[{"name":"","phoneNumber":"","password":""}]&_=1470230696600

What does this mean: &_=1470230696600?

  • 写回答

3条回答 默认 最新

  • weixin_33726313 2016-08-03 13:41
    关注

    Replace datatype from jsonp to json. You can read more about the difference between json and jsonp here What are the differences between JSON and JSONP?

    评论

报告相同问题?