mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 13:51:20 +08:00
http method options
This commit is contained in:
@ -11,7 +11,10 @@ A List of API endpoints that can be used for testing API Dash
|
||||
|
||||
#### For Testing HTTP PUT, PATCH, DELETE
|
||||
- https://reqres.in/
|
||||
|
||||
|
||||
#### For Testing HTTP OPTIONS, TRACE
|
||||
- Use localhost servers, as TRACE and OPTIONS HTTP methods are not publicly available (used for diagnostic purposes)
|
||||
|
||||
#### For Testing sites with Bad Certificate
|
||||
- https://badssl.com/
|
||||
- https://www.ssl.com/sample-valid-revoked-and-expired-ssl-tls-certificates/
|
||||
|
@ -51,6 +51,7 @@ Color getHTTPMethodColor(HTTPVerb? method) {
|
||||
HTTPVerb.put => kColorHttpMethodPut,
|
||||
HTTPVerb.patch => kColorHttpMethodPatch,
|
||||
HTTPVerb.delete => kColorHttpMethodDelete,
|
||||
HTTPVerb.options => kColorHttpMethodOptions,
|
||||
_ => kColorHttpMethodGet,
|
||||
};
|
||||
return col;
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -23,6 +23,7 @@ final kColorHttpMethodPost = Colors.blue.shade800;
|
||||
final kColorHttpMethodPut = Colors.amber.shade900;
|
||||
final kColorHttpMethodPatch = kColorHttpMethodPut;
|
||||
final kColorHttpMethodDelete = Colors.red.shade800;
|
||||
final kColorHttpMethodOptions = Colors.yellow.shade800;
|
||||
|
||||
final kColorGQL = Colors.pink.shade600;
|
||||
|
||||
|
Reference in New Issue
Block a user