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:
@ -12,6 +12,9 @@ A List of API endpoints that can be used for testing API Dash
|
|||||||
#### For Testing HTTP PUT, PATCH, DELETE
|
#### For Testing HTTP PUT, PATCH, DELETE
|
||||||
- https://reqres.in/
|
- 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
|
#### For Testing sites with Bad Certificate
|
||||||
- https://badssl.com/
|
- https://badssl.com/
|
||||||
- https://www.ssl.com/sample-valid-revoked-and-expired-ssl-tls-certificates/
|
- https://www.ssl.com/sample-valid-revoked-and-expired-ssl-tls-certificates/
|
||||||
|
@ -51,6 +51,7 @@ Color getHTTPMethodColor(HTTPVerb? method) {
|
|||||||
HTTPVerb.put => kColorHttpMethodPut,
|
HTTPVerb.put => kColorHttpMethodPut,
|
||||||
HTTPVerb.patch => kColorHttpMethodPatch,
|
HTTPVerb.patch => kColorHttpMethodPatch,
|
||||||
HTTPVerb.delete => kColorHttpMethodDelete,
|
HTTPVerb.delete => kColorHttpMethodDelete,
|
||||||
|
HTTPVerb.options => kColorHttpMethodOptions,
|
||||||
_ => kColorHttpMethodGet,
|
_ => kColorHttpMethodGet,
|
||||||
};
|
};
|
||||||
return col;
|
return col;
|
||||||
|
@ -17,7 +17,8 @@ enum HTTPVerb {
|
|||||||
post("POST"),
|
post("POST"),
|
||||||
put("PUT"),
|
put("PUT"),
|
||||||
patch("PAT"),
|
patch("PAT"),
|
||||||
delete("DEL");
|
delete("DEL"),
|
||||||
|
options("OPT");
|
||||||
|
|
||||||
const HTTPVerb(this.abbr);
|
const HTTPVerb(this.abbr);
|
||||||
final String abbr;
|
final String abbr;
|
||||||
|
@ -104,6 +104,17 @@ Future<(HttpResponse?, Duration?, String?)> sendHttpRequest(
|
|||||||
final streamed = await client.send(request);
|
final streamed = await client.send(request);
|
||||||
response = await http.Response.fromStream(streamed);
|
response = await http.Response.fromStream(streamed);
|
||||||
break;
|
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) {
|
if (apiType == APIType.graphql) {
|
||||||
|
@ -23,6 +23,7 @@ final kColorHttpMethodPost = Colors.blue.shade800;
|
|||||||
final kColorHttpMethodPut = Colors.amber.shade900;
|
final kColorHttpMethodPut = Colors.amber.shade900;
|
||||||
final kColorHttpMethodPatch = kColorHttpMethodPut;
|
final kColorHttpMethodPatch = kColorHttpMethodPut;
|
||||||
final kColorHttpMethodDelete = Colors.red.shade800;
|
final kColorHttpMethodDelete = Colors.red.shade800;
|
||||||
|
final kColorHttpMethodOptions = Colors.yellow.shade800;
|
||||||
|
|
||||||
final kColorGQL = Colors.pink.shade600;
|
final kColorGQL = Colors.pink.shade600;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user