http method options

This commit is contained in:
Rio Jos
2025-04-24 13:05:00 +05:30
parent b65d23337b
commit aa8e5c3d03
5 changed files with 19 additions and 2 deletions

View File

@@ -17,7 +17,8 @@ enum HTTPVerb {
post("POST"),
put("PUT"),
patch("PAT"),
delete("DEL");
delete("DEL"),
options("OPT");
const HTTPVerb(this.abbr);
final String abbr;

View File

@@ -104,6 +104,17 @@ Future<(HttpResponse?, Duration?, String?)> sendHttpRequest(
final streamed = await client.send(request);
response = await http.Response.fromStream(streamed);
break;
case HTTPVerb.options:
final request = prepareHttpRequest(
url: requestUrl,
method: requestModel.method.name.toUpperCase(),
headers: headers,
body: body,
overrideContentType: overrideContentType,
);
final streamed = await client.send(request);
response = await http.Response.fromStream(streamed);
break;
}
}
if (apiType == APIType.graphql) {