Skip to main content

get

get

Performs an HTTP GET request to the given URL. The response is delivered asynchronously to jsCallback.

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

ArgumentTypeDescription
statusCodenumberThe response status code
headersMapThe response headers
bodyStringThe response body

Returns: void

Example

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