Skip to main content

head

Performs an HTTP HEAD request — headers only, no body.

Parameters

NameTypeDescription
urlStringThe URL to request
headersMap?Request headers. Optional (null). Merged into the default headers (Content-Type: application/json, Accept: application/json) before sending
jsCallbackJSFunction?The callback that receives the response

Callback

Invoked as jsCallback(statusCode, headers, body). body is always empty.

ArgumentTypeDescription
statusCodenumberThe response status code
headersMapThe response headers
bodyStringThe response body (always empty, since this is a HEAD request)

Returns: void

Example

$http.head("https://api.example.com/user/1", {}, function (status, headers, body) {
$log.d(status, headers);
});