tencent cloud

最終更新日:2025-03-11 19:41:11
BatchOption
最終更新日: 2025-03-11 19:41:11
BatchOption is the configuration option used when initiating HTTP requests in batch.

Field

Field
Type
Description
parallel?
number
Optional; concurrent count, defaults to 20.

Usage Examples

The configuration for batch requests using BatchOption:
import http from 'pts/http';

export default function () {
const responses = http.batch(
[
{
method: 'GET',
url: 'http://httpbin.org/get?a=1',
headers: { a: '1, 2, 3' },
query: { b: '2' },
}
{
method: 'GET',
url: 'http://httpbin.org/get?a=1',
headers: { a: '1, 2, 3' },
query: { b: '2' },
}
]
// BatchOption configuration options.
{
parallel: 1,
}
);
console.log(JSON.stringify(responses));
}

この記事はお役に立ちましたか?
営業担当者に お問い合わせ いただくか チケットを提出 してサポートを求めることができます。
はい
いいえ

フィードバック