我知道model/collection RESTful的东西。但是我需要在ajax中定制ampersand.js调用,但是我似乎找不到它的API。我应该转而使用普通的旧xmlhttprequest吗?
发布于 2016-02-18 13:59:18
如果使用自定义调用填充model/collection,则应考虑使用ajaxConfig选项。
否则,您只需使用一个像xhr这样的ampersand-sync自己使用的模块来抽象xmlhttprequest,例如:
var xhr = require("xhr")
xhr({
body: someJSONString,
uri: "/foo",
headers: {
"Content-Type": "application/json"
}
}, function (err, resp, body) {
// check resp.statusCode
})https://stackoverflow.com/questions/35481127
复制相似问题