我在
Auth0 Delegated Administration Extension中使用了创建钩子.
我在触发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)
创建Hook功能是:
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,我遇到了错误.
可能是什么问题?
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。