当前位置: 代码迷 >> JavaScript >> 矩形删除和放置错误net :: ERR_NAME_NOT_RESOLVED
  详细解决方案

矩形删除和放置错误net :: ERR_NAME_NOT_RESOLVED

热度:40   发布时间:2023-06-12 13:46:54.0

当我尝试使用restangular进行放置或删除时出现此错误,并且post和getList()完美运行,当我要编辑mi对象时,我创建了这样的对象

edited = Restangular.copy(danger);

危险是我从表的模板中获取我的modelobject,我只是从表中获取对象,该对象很好。 然后在我的功能中,我只是尝试做

edited.put();

错误是选项 dangers net :: ERR_NAME_NOT_RESOLVED

就像restangular不会生成网址一样,帖子网址是

我在开发环境中将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( '/');