List Repos: Print the http req as curl

Makes it easier to test
This commit is contained in:
Vishesh Handa
2020-09-05 11:03:15 +02:00
parent 43fd939103
commit ccf5f65e55
3 changed files with 21 additions and 0 deletions

View File

@ -78,3 +78,12 @@ bool folderWithSpecExists(BuildContext context, String spec) {
return rootFolder.getFolderWithSpec(spec) != null;
}
String toCurlCommand(String url, Map<String, String> headers) {
var headersStr = "";
headers.forEach((key, value) {
headersStr += ' -H "$key: $value" ';
});
return "curl -X GET '$url' $headersStr";
}