web前端ajax请求接口时,发生error。{“error”: {“message”: “Only Support POST Method”, “code”: 1001}}

laughingxj
2017-08-03 10:23 2k 0
$.ajax({
        type:'POST',
        headers:{
            'Authorization':'Basic YTZkYjU3ZGNmNmE5NmE4Y2NkNjQyMWY0OmJlM2JhYWZiODU0ODA0YjZiOTM3OTk4NA==',
        },
        crossDomain : true,
        async: true,
        url:'https://api.jpush.cn/v3/push',
        dataType: 'json',
        data:{
            "platform": ["android"],
            "audience": {
                "alias":'alias_0'
            },
            "notification": {
                "android": {
                    "alert": "Hi, JPush!",
                    "title": "Send to Android"
                }
            }
        },
        success:function(res){
            alert(JSON.stringify(res));
        }
    });

1个回答

热门排序
  • laughingxj
    2017-08-03 10:35
    test-Jpush.html:1 XMLHttpRequest cannot load https://api.jpush.cn/v3/push. Response to preflight request doesn't pass ac 展示全部