-1
我在我的模型上创建了一个名为'post'的函数,我想通过POST请求通过自定义url(下面的示例)向服务器发送请求。我如何设置url而不影响rootUrl发送请求? TIA!Backbone.JS:模型功能的自定义url
MyModel = Backbone.Model.extend({
urlRoot: '../mymodel'
initialize: function(){
},
post: function(){
// how put the url here?
// this is the custom url: '../post/mymodel/' + this.model.get('id')
// this is the expected log on server:
// POST: ../post/mymodel/323133
});
谢谢!但我怎么能通过POST请求? – jrsalunga