aboutsummaryrefslogtreecommitdiffstats
path: root/fbench/src/geturl/geturl.cpp
blob: f279b0b55c89926fc41a243c9930267edd563f4c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <httpclient/httpclient.h>
#include <iostream>

int
main(int argc, char** argv)
{
    if (argc != 4) {
        printf("usage: vespa-fbench-geturl <host> <port> <url>\n");
        return -1;
    }

    HTTPClient  client(argv[1], atoi(argv[2]), false, false);
    if (!client.Fetch(argv[3], &std::cout).Ok()) {
        fprintf(stderr, "geturl: could not fetch 'http://%s:%d%s'\n",
                argv[1], atoi(argv[2]), argv[3]);
        return -1;
    }
    return 0;
}