[英]restangular remove and put error net::ERR_NAME_NOT_RESOLVED
當我嘗試使用restangular進行放置或刪除時出現此錯誤,並且post和getList()完美運行,當我要編輯mi對象時,我創建了這樣的對象
edited = Restangular.copy(danger);
危險是我從表的模板中獲取我的modelobject,我只是從表中獲取對象,該對象很好。 然后在我的功能中,我只是嘗試做
edited.put();
錯誤是選項http:// dangers / 1 / net :: ERR_NAME_NOT_RESOLVED
就像restangular不會生成網址一樣,帖子網址是http:// localhost:8000 / dangers /
我在開發環境中將gulp與代理一起使用以捕獲api請求
gulp.task('server', ['build'], function() {
gulp.src('./build')
.pipe($.webserver({
port: 8080,
host: 'localhost',
fallback: 'index.html',
livereload: {
enable: true,
port: 8181
},
open: true,
// django app
proxies: [{
source: '/api',
target: 'http://localhost:8000/api'
}]
}));
});
這是我的錯誤django restframework需要在解決方案要添加到restangular的配置中的每個URL中添加斜杠
RestangularProvider.setRequestSuffix( '/');
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.