node.js - 如何在 NodeJs for Akamai 的 Axios 调用中设置 Keep Alive 时间
问题描述
我有一个问题,即在节点 js 应用程序等待 API 调用完成时,Akamai 服务器发送 503 错误。根据此处的 Akamai 文档,我想将超时值增加到 303 秒。我有以下 Axios 调用,我想为此增加超时。
const options = {
method: 'POST',
url: config.endpoint,
headers:
{
'Content-Type': 'application/json;charset=utf-8',
'Accept': 'application/json',
authorization: 'Bearer ' + token,
},
data: data,
json: true
};
axios(options)
.then(response => convertObjectKeysToLowercasePromise(response.data))
.then(response => {
resolve(response)
})
.catch(function (error) {
logger.error({
message: `Error occured: ${error}`
});
}
如何按照 Akamai 的建议在这里增加 Keep alive 超时?
解决方案
推荐阅读
- java - 从某个索引通过引用传递数组
- ruby-on-rails - 提示选项不适用于 select_tag
- wso2 - gRPC 和 WSO2 Api 管理器
- apache-spark - SparkContext.addFile 将文件上传到驱动节点而不是工作节点
- sql - MS SQL.跨列的各种值的总和
- python - 如何从 Jupyter 笔记本中删除 emacs 键绑定?
- ios - 苹果新证书——私钥在哪里?
- solr - MongoDB with Apache Solr:你应该在 Solr 中索引整个集合吗?如果没有,那么如何根据 solr 索引搜索查询获取完整的文档
- javascript - 用该数组中的值填充数组
- react-native - 在本机反应中处理对 web 视图内 url 的导航