我在Auth0委派管理扩展中使用了一个
当触发创建挂钩时,我遇到了以下错误:
创建钩子函数是:
我已经尝试使用Postman并且它按预期工作。但是,使用create hook时,我遇到了上述错误。
可能出了什么问题?
create hook
。当触发创建挂钩时,我遇到了以下错误:
Error: connect ETIMEDOUT xxx.xxx.xxx.xxx:8081
at Object.exports._errnoException (util.js:1020:11)
at exports._exceptionWithHostPort (util.js:1043:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
创建钩子函数是:
function(ctx, callback) {
var request = require('request');
// Perform any asynchronous actions
var API_URL = "https://example.com:8081/api/saveData";
var empFirstName = 'Jhone';
var empId = '123';
request.post({
url: API_URL,
json: {
firstName: empFirstName,
userId: empId
}
},
function(error, response, body) {
if (error) {
ctx.log('Create failed to '+API_URL+':', error);
return callback(new Error('Something went wrong. Please try again.'));
}
ctx.log('Create successful! Server responded with:', body);
return callback(null, {
/*some data here*/
});
});
}
我已经尝试使用Postman并且它按预期工作。但是,使用create hook时,我遇到了上述错误。
可能出了什么问题?