From e3cdaafd88884af9d03fa7a949b379344cd0b145 Mon Sep 17 00:00:00 2001 From: Th3maz1ng Date: Sat, 9 Apr 2022 19:10:18 +0200 Subject: [PATCH] Updated the sendHttpQuery method to now return an error code which tells the line corresponding to the return of the failure --- src/app/HttpClient.cpp | 18 +++++++++--------- src/app/HttpClient.h | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/app/HttpClient.cpp b/src/app/HttpClient.cpp index b56438f..db485c7 100644 --- a/src/app/HttpClient.cpp +++ b/src/app/HttpClient.cpp @@ -73,7 +73,7 @@ boolean HttpClient::connectByHostOrIp() return _connectionStatus == SUCCESSFUL; } -boolean HttpClient::sendHttpQuery(const char *resource, HttpRequestMethod method, Dictionary *getData, Dictionary *postData, Dictionary *headerData) +int HttpClient::sendHttpQuery(const char *resource, HttpRequestMethod method, Dictionary *getData, Dictionary *postData, Dictionary *headerData) { if(resource != NULL) //We overwrite the resource if it has been already defined { @@ -88,7 +88,7 @@ boolean HttpClient::sendHttpQuery(const char *resource, HttpRequestMethod method return sendHttpQuery(method, getData, postData, headerData); } -boolean HttpClient::sendHttpQuery(HttpRequestMethod method, Dictionary *getData, Dictionary *postData, Dictionary *headerData) +int HttpClient::sendHttpQuery(HttpRequestMethod method, Dictionary *getData, Dictionary *postData, Dictionary *headerData) { //We reset this two flags _httpCode = HTTP_CODE::UNDEFINED_CODE; @@ -101,7 +101,7 @@ boolean HttpClient::sendHttpQuery(HttpRequestMethod method, Dictionary *getData = NULL, Dictionary *postData = NULL, Dictionary *headerData = NULL); - boolean sendHttpQuery(HttpRequestMethod method = HttpRequestMethod::GET, + int sendHttpQuery(HttpRequestMethod method = HttpRequestMethod::GET, Dictionary *getData = NULL, Dictionary *postData = NULL, Dictionary *headerData = NULL);