requestOPTIONS method
Future<HttpResponse>
requestOPTIONS(
- HttpClient client,
- String url, {
- Map<
String, String> ? headers, - Authorization? authorization,
- Map<
String, String?> ? queryParameters, - bool noQueryString = false,
- ProgressListener? progressListener,
Implementation
Future<HttpResponse> requestOPTIONS(
HttpClient client,
String url, {
Map<String, String>? headers,
Authorization? authorization,
Map<String, String?>? queryParameters,
bool noQueryString = false,
ProgressListener? progressListener,
}) async {
var requestURL = buildRequestURL(
client,
url,
authorization: authorization,
queryParameters: queryParameters,
noQueryString: noQueryString,
);
var requestHeaders = buildRequestHeaders(
client,
HttpMethod.OPTIONS,
url,
headers: headers,
authorization: authorization,
);
var requestURLOr = client._interceptRequest(
HttpMethod.OPTIONS,
requestURL,
requestHeaders,
);
// Awaited only with an interceptor (no asynchronous step without it).
requestURL = requestURLOr is Future<String>
? await requestURLOr
: requestURLOr;
return submitHttpRequest(
client,
HttpRequest(
HttpMethod.OPTIONS,
url,
requestURL,
authorization: authorization,
queryParameters: queryParameters,
noQueryString: noQueryString,
withCredentials: _withCredentials(client, authorization),
requestHeaders: requestHeaders,
),
progressListener,
client.logRequests,
);
}