tencent cloud

Performance Testing Service

http.get

PDF
Focus Mode
Font Size
Last updated: 2025-03-10 17:04:47
http.get is used to initiate GET requests.
get(url:string, request?: Request): Response

Parameters

Parameter
Type
Description
url
string
URL string.
request
Optional; request object. The method and url fields in the request object will not override the method and url in the current method http.get.

Return

Type
Description
Response object.

Samples

Initiate a GET request:
import http from 'pts/http';

export default function () {
const data = { user_id: '12345' };
const req = {
query: data,
};
const resp = http.get('http://httpbin.org/get', req);
console.log(resp.json().args.user_id); // 12345
}


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback