tencent cloud

Last updated: 2025-03-11 19:41:09
HTTP
Last updated: 2025-03-11 19:41:09
HTTP is the http configuration in the global parameter configuration Option.

Field

Field
Type
Description
maxRedirects?
number
Optional; the maximum number of redirects.
maxIdleConns?
number
Optional; the maximum number of active connections per VU.
maxIdleConnsPerHost?
number
Optional; the maximum number of active connections per VU per domain name.
disableKeepAlives?
boolean
Optional; whether to disable persistent connections.
headers?
Record<string, string>
Optional; request headers.
timeout?
number
Optional; the request timeout period in milliseconds.
basicAuth?
BasicAuth
Optional; basic authentication.
discardResponseBody?
boolean
Optional; whether to discard response packets.
http2?
boolean
Optional; whether to enable HTTP2.

Samples

Use HTTP Option:
export const option = {
http: {
maxRedirects: 5,
maxIdleConns: 50,
maxIdleConnsPerHost: 10,
disableKeepAlives: true,
headers: {
'key': 'value'
}
timeout: 3000,
basicAuth: {
username: 'user',
password: 'passwd'
}
discardResponseBody: true,
http2: true
}
}

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback