tencent cloud

All product documents
Tencent Cloud Observability Platform
http.patch
Last updated: 2025-03-11 19:41:10
http.patch
Last updated: 2025-03-11 19:41:10
http.patch is used to initiate PATCH requests.
patch(url:string, body: string | object | Record<string, string>, request?: Request): Response

Parameters

Parameter
Type
Description
url
string
URL string.
body
string, object, or Record<string, string>.
Request body.
request
Request
Optional; request object. The method, url, and body fields in the request object will not override the method, url, and body in the current method http.patch.

Return

Type
Description
Response
Response object.

Samples

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

export default function () {
const data = { user_id: '12345' };
const headers = { 'Content-Type': 'application/json' };
const request = {
headers,
};
//@ts-ignore Ignore the verification.
const resp1 = http.patch('http://httpbin.org/patch', data, request);
const resp2 = http.patch('http://httpbin.org/patch', '123', request);
console.log(resp1.json().json.user_id); // 12345
console.log(resp2.json().json); // 123
}

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 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon