tencent cloud

Performance Testing Service

Overview
Purchase Guide
Billing Overview
Pay-as-You-Go (postpaid)
Purchasing Channels
Payment Overdue
Refund Instructions
Quick Start
Operation Guide
Performance Testing in Simple Mode
Performance Testing in Script Mode
Performance Testing in JMeter Mode
Project Management
Scenario Management
Traffic Recording
Environment Management
Scheduled Performance Testing
Performance Testing Report
Access Control
Alarm Management
Tag Management
Error Code Manual
Practice Tutorial
Using Prometheus To Monitor Performance Testing Metrics
Using PTS to Playback Requests Recorded by GoReplay
API Documentation
History
Introduction
API Category
Making API Requests
PTS-related APIs
Data Types
Error Codes
JavaScript API List
Overview of JavaScript API List
pts/global
pts/http
pts
pts/dataset
pts/grpc
pts/jsonpath
pts/protobuf
pts/redis
pts/sql
pts/url
pts/util
pts/ws
pts/socketio
pts/socket
FAQs
Related Agreements
Service Level Agreement
Use Limits
Privacy Policy
Data Processing And Security Agreement

Response Overview

PDF
Focus Mode
Font Size
Last updated: 2025-03-10 17:04:50
Response is the result obtained after a request is made.

Field

Field
Type
Description
body
string
The response returned by the server.
contentLength
number
The length of the server response body.
headers
Record<string, string>
The HTTP headers of the server response.
proto
string
Protocol, such as "HTTP/1.0".
request
The request sent to obtain this response.
responseTimeMS
number
The response time of the request in milliseconds.
status
string
The HTTP status message from the server response, such as "200 OK".
statusCode
number
The HTTP status code from the server response, such as "200".

Methodology

Methodology
Return Type
Description
any
Deserialize Response.body to json.

Samples

import http from 'pts/http';

export default function () {
const req = {
method: 'post',
url: 'http://httpbin.org/post',
headers: { 'Content-Type': 'application/json' },
query: { a: '1' },
body: { user_id: '12345' },
};
const resp = http.do(req);

console.log(resp.json()); // [Object object]
console.log(resp.json().args.a); // 1
console.log(resp.json().json.user_id); // 12345
}


Help and Support

Was this page helpful?

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

Feedback