head
head
Performs an HTTP HEAD request — headers only, no body.
Parameters
| Name | Type | Description |
|---|---|---|
url | String | The URL to request |
headers | Map? | Request headers. Optional (null). Merged into the default headers (Content-Type: application/json, Accept: application/json) before sending |
jsCallback | JSFunction? | The callback that receives the response |
Callback
Invoked as jsCallback(statusCode, headers, body). body is always empty.
| Argument | Type | Description |
|---|---|---|
statusCode | number | The response status code |
headers | Map | The response headers |
body | String | The 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);
});