Skip to main content

options

options

Performs an HTTP OPTIONS request for capability and CORS discovery. The http package has no OPTIONS method, so it's sent directly through Request.

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.options("https://api.example.com/user/1", {}, function (status, headers, body) {
$log.d(status, headers);
});