From e05c5ca197d7ccac7ea20db78c1e101090ff629a Mon Sep 17 00:00:00 2001 From: Naveen Date: Mon, 23 Nov 2015 10:08:38 +0000 Subject: Add Chat class --- src/Api.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Api.cpp') diff --git a/src/Api.cpp b/src/Api.cpp index 9c8259f..2e3af45 100644 --- a/src/Api.cpp +++ b/src/Api.cpp @@ -256,14 +256,20 @@ void Api::setWebhook(const string& url) const { } ptree Api::sendRequest(const string& method, const vector& args) const { + string url = "https://api.telegram.org/bot"; url += _token; url += "/"; url += method; + + std::cout << "URL: " << url << std::endl; string serverResponse = HttpClient::getInstance().makeRequest(url, args); if (serverResponse.find("") != serverResponse.npos) { throw TgException("tgbot-cpp library have got html page instead of json response. Maybe you entered wrong bot token."); } + + std::cout << "Server Response: " << serverResponse << std::endl; + ptree result = TgTypeParser::getInstance().parseJson(serverResponse); try { if (result.get("ok", false)) { -- cgit v1.2.3