diff options
author | Sara Golemon <sara.golemon@mongodb.com> | 2018-07-27 17:01:29 +0000 |
---|---|---|
committer | Sara Golemon <sara.golemon@mongodb.com> | 2018-08-01 23:10:03 +0000 |
commit | b6916d8a80a75e359654a3dfa59990d873be45fd (patch) | |
tree | 7517b99b45d551384c435616847ba9d8f2797461 /src/mongo/util/net/http_client.h | |
parent | be2588ebda13c512cde2d7999a0deebb2531004c (diff) | |
download | mongo-b6916d8a80a75e359654a3dfa59990d873be45fd.tar.gz |
SERVER-36363 Support GET requests in HTTPClient
Diffstat (limited to 'src/mongo/util/net/http_client.h')
-rw-r--r-- | src/mongo/util/net/http_client.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/mongo/util/net/http_client.h b/src/mongo/util/net/http_client.h index e10c1f94900..69055b394b8 100644 --- a/src/mongo/util/net/http_client.h +++ b/src/mongo/util/net/http_client.h @@ -32,6 +32,7 @@ #include <memory> #include <vector> +#include "mongo/base/data_builder.h" #include "mongo/base/data_range.h" #include "mongo/base/string_data.h" #include "mongo/executor/thread_pool_task_executor.h" @@ -64,14 +65,24 @@ public: /** * Perform a POST request to specified URL. */ - virtual std::vector<uint8_t> post(const std::string& url, ConstDataRange data) const = 0; + virtual DataBuilder post(StringData url, ConstDataRange data) const = 0; /** * Futurized helper for HttpClient::post(). */ - Future<std::vector<uint8_t>> postAsync(executor::ThreadPoolTaskExecutor* executor, - StringData url, - std::shared_ptr<std::vector<std::uint8_t>> data) const; + Future<DataBuilder> postAsync(executor::ThreadPoolTaskExecutor* executor, + StringData url, + std::shared_ptr<std::vector<std::uint8_t>> data) const; + + /** + * Perform a GET request from the specified URL. + */ + virtual DataBuilder get(StringData url) const = 0; + + /** + * Futurized helpr for HttpClient::get(). + */ + Future<DataBuilder> getAsync(executor::ThreadPoolTaskExecutor* executor, StringData url) const; /** * Factory method provided by client implementation. |