Axios - 错误:请求失败,状态码为 503

问题描述

嗨,我正在尝试在服务器端(节点 js)上使用 axios 并调用 post 请求。下面是我的代码。当我使用邮递员时它工作正常,但是当从节点 js 命中时它给出 503(服务不可用)。我在这里做错了什么吗?

    try {
        const sendInvitePayload = {
            UID: "132465789",invitees: [
                "9200000000"
            ],customerType: "consumer"
        }

        const sendInviteOptions = {
            method: 'post',url: "http://xxxxxxx,headers: headers,data: sendInvitePayload
        };

        logger.info({
            event: 'send invite request to non jazz cash user options',functionName: 'sendMoneyService.confirmNonJcPaymentC2C',data: sendInviteOptions,});

        const inviteResponse = await axios(sendInviteOptions);
        console.log(inviteResponse)
    } catch (error) {

        logger.error({
            event: 'Failure : Exited function',error: { message: error.message,stack: error.stack },});

        return false;

    }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)