簡體   English   中英

如何為requestretry添加自定義header?

[英]How to add custom header for requestretry?

我的電話是這樣的,

const { get, post } = require('requestretry');
const { promisify } = require('util');
const [getAsync, postAsync] = [get, post].map(promisify);

    const res = await postAsync({
        url: "some url",
        json: messageObj, // request body
        maxAttempts: 5,
        retryDelay: 1000
    });

請問在哪里可以添加自定義 header? https://www.npmjs.com/package/requestretry?activeTab=readme

const res = await postAsync({
    url: "some url",
    headers: {...},
    json: messageObj, // request body
    maxAttempts: 5,
    retryDelay: 1000
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM