tencent cloud

Performance Testing Service

Related Agreements
Service Level Agreement
Use Limits
Privacy Policy
Data Processing And Security Agreement
ドキュメントPerformance Testing Service

http.patch

フォーカスモード
フォントサイズ
最終更新日: 2025-03-10 17:04:47
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
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 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
}


ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック