jQuery POST vs OPTIONS

时间:2013-10-15 10:30:26

标签: jquery ajax web-services

我正在尝试使用jQuery Ajax来消费休息服务。 Ajax请求类型是'POST'。当我尝试加载它时,请求将作为“OPTIONS”,我得到“501 Not Implemented”(如图所示)

<script>
var user ="user:pwd";
var auth = "Basic " + btoa(user);

    $(function(){
        $.ajax({
            type: 'post',
            url: 'https://xyz/api/core/v3/xyz',
            dataType: 'json',
            contentType: 'application/json',
            data: '{"title":"test","content":"testpega" }',

            success: function(resp) {
                $('#log').html("success");
            },
            error: function(e) {

                $('#log').html("error: "+e);
            }
        });
    });

</script>   

501 Respose

任何帮助/建议?

注意:我可以使用与FireFox rest-client插件相同的Web服务。

0 个答案:

没有答案
相关问题