tencent cloud

http.head
Last updated: 2025-03-10 17:04:47
http.head
Last updated: 2025-03-10 17:04:47
http.head is used to initiate HEAD requests.
head(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.head.

Return

Type
Description
Response object.

Samples

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

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

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

Feedback