aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/utils.cpp')
-rw-r--r--src/cli/utils.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cli/utils.cpp b/src/cli/utils.cpp
index 094665a00..161cc24bf 100644
--- a/src/cli/utils.cpp
+++ b/src/cli/utils.cpp
@@ -218,11 +218,15 @@ BOTAN_REGISTER_COMMAND("rng", RNG);
class HTTP_Get final : public Command
{
public:
- HTTP_Get() : Command("http_get url") {}
+ HTTP_Get() : Command("http_get --redirects=1 --timeout=3000 url") {}
void go() override
{
- output() << Botan::HTTP::GET_sync(get_arg("url")) << "\n";
+ const std::string url = get_arg("url");
+ const std::chrono::milliseconds timeout(get_arg_sz("timeout"));
+ const size_t redirects = get_arg_sz("redirects");
+
+ output() << Botan::HTTP::GET_sync(url, redirects, timeout) << "\n";
}
};