tencent cloud

Performance Testing Service

Related Agreements
Service Level Agreement
Use Limits
Privacy Policy
Data Processing And Security Agreement
문서Performance Testing Service

BatchOption

포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-03-10 17:04:48
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));
}


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백