diff options
author | kukin-konstantin <kukin.konstantin@gmail.com> | 2017-03-20 19:55:17 +0300 |
---|---|---|
committer | kukin-konstantin <kukin.konstantin@gmail.com> | 2017-03-20 19:55:17 +0300 |
commit | 156c087f3eeeeffb949ae6a572dd7b52815eb0e5 (patch) | |
tree | 60af55841a59d7af13bb492d248e0744478e8056 /src/Api.cpp | |
parent | b68611144a92b266ab20b7db8fbce723bb499b70 (diff) |
add function download file
Diffstat (limited to 'src/Api.cpp')
-rw-r--r-- | src/Api.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Api.cpp b/src/Api.cpp index 6fd86c2..b7a53c1 100644 --- a/src/Api.cpp +++ b/src/Api.cpp @@ -681,4 +681,15 @@ ptree Api::sendRequest(const string& method, const vector<HttpReqArg>& args) con } } +std::string Api::downloadFile(const std::string& filePath, const std::vector<HttpReqArg>& args) const { + string url = "https://api.telegram.org/file/bot"; + url += _token; + url += "/"; + url += filePath; + + string serverResponse = HttpClient::getInstance().makeRequest(url, args); + + return serverResponse; +} + } |