0
Follow
0
View

Request-promise uses a proxy to send a request

daituzhe 注册会员
2023-02-28 16:19
< div class = "md_content_show e397 data - v - 3967" = "" >

thank you very much!!!!!!

dx22955 注册会员
2023-02-28 16:19

You can add the proxy configuration to the request options.

const request = require('request-promise');
const options = {
    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,
    proxy: 'http://代理地址'
};

const result = await request(options);