无法使用集合的获取方法POST数据

时间:2014-10-19 02:26:09

标签: backbone.js

根据我的理解,我能够使用我的集合来获取,POST数据,到api。在这种情况下,我使用Bing翻译api。

我的提取看起来像这样:

app.searches.fetch({

                    contentType: "application/x-www-form-urlencoded",
                    type: 'POST',
                    data:  { client_id: 'test',client_secret:'test', scope:'http://api.microsofttranslator.com', grant_type: 'client_credentials'},
                    dataType: 'jsonp',

                    success: function () {



                    }
                });

每次此fetch触发时,它都会执行GET,而不是POST。现在,我的项目是贫瘠的,所以我不认为有任何干扰。我写错了吗?

编辑:

这里是集合:

var app = app || {};

(function(){
    'use strict';

    // Searches Collection
    //---------------------

    var Searches = Backbone.Collection.extend({
        //referebce to this collection's model
        model: app.Search,
        url: 'https://datamarket.accesscontrol.windows.net/v2/OAuth2-13'

    });



    app.searches = new Searches();

})();

0 个答案:

没有答案