egg.js后端使用request-promise调用一个钉钉的API接口时,因为公司网络问题需要使用代理,代理应该填写在什么位置?
const result = await requestPromise({
uri: 'https://api.dingtalk.com/v1.0/im/v1.0/robot/interactiveCards/send',
method: "POST",
json: true,
headers: {
"x-acs-dingtalk-access-token": access_token,
"content-type": "application/json",
},
body: sendval,
});
使用Python调用的时候有对应的包,提供了一个 util_models.RuntimeOptions 的方法,具体如下:
import requests
from alibabacloud_dingtalk.im_1_0.client import Client as dingtalkim_1_0Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_dingtalk.im_1_0 import models as dingtalkim__1__0_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient
res = client.send_interactive_card_with_options(send_interactive_card_request, send_interactive_card_headers, util_models.RuntimeOptions(http_proxy='http://代理地址',https_proxy='http://代理地址'))