【发布时间】:2015-12-30 04:42:48
【问题描述】:
尝试使用 auth0 发出 PUT 请求时,我一直遇到 404“未找到用户”错误。
我正在尝试更新用户并使用他们的文档告诉我使用的确切端点进行此 API 调用。
当从他们的文档(他们有一个内置测试)拨打电话时,我发送的正文一切正常,我收到了 200 条成功消息。
当我尝试从我的应用程序发出相同的调用时,我不断收到 404 未找到用户错误。
但是,当我使用具有相同 user_id 的相同端点从我的应用程序 GET 时,一切正常(证明我的 cliendID 配置正确)。
为什么会失败?
var updateAuthUser = function(){
var request = {
"user_metadata": {
"springboardID": 100055
}
}
var update = $http.put('https://app36591925.auth0.com/api/v2/users/auth0%7C5606b3c4b0c70b49698612fc', request);
update.then(function(response) {
console.log("update success", response);
}, function(response) {
console.log("update failure", response);
});
return update;
}
工作 GET 请求:
var getAuthUser = function(){
$http.get('https://app36591925.auth0.com/api/v2/users/auth0|5606b3c4b0c70b49698612fc')
.then(function(response){
console.log("response", response);
var deferred = $q.defer();
deferred.resolve(response);
return deferred.promise;
});
}
【问题讨论】:
标签: angularjs http-status-code-404 put auth0