tencent cloud

All product documents
Tencent Cloud Observability Platform
Response Overview
Last updated: 2025-03-11 19:41:12
Response Overview
Last updated: 2025-03-11 19:41:12
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
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
json()
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
}

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

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support