headAjax function

Future<Response> headAjax(
  1. Uri url, {
  2. Map<String, String>? headers,
  3. Duration? timeout,
})

Sends an Ajax request to the given url using the HEAD method.

Unlike ajax, the returned http.Response.contentLength reflects the wire's Content-Length header — http.Response.fromStream would otherwise report 0 for HEAD (the body is empty by definition).

Implementation

Future<http.Response> headAjax(Uri url, {
    Map<String, String>? headers,
    Duration? timeout})
=> _ajax(url, method: "HEAD", headers: headers, timeout: timeout,
    getResponse: _headResponse);