support json index

This commit is contained in:
John
2023-10-13 23:50:20 +02:00
parent 730d92d06c
commit dc78076fbc
3 changed files with 55 additions and 8 deletions
+8 -2
View File
@@ -191,10 +191,13 @@ class HttpClient {
* @param repeatable optional pointer to a bool in which to store whether the request should be repeated later on
* (e.g. due to temporary connectivity issues).
* @param time optional pointer to a @a time_t value for storing the modification time of the file, or nullptr.
* @param jsonString optional pointer to a bool value. When returning, it is set to whether the retrieved
* content-type indicates JSON. When true upon entry, content is JSON, and response is a single JSON string, it
* will be de-escaped to a pure string and the value set to false.
* @return true on success, false on error.
*/
bool get(const string& uri, const string& body, string* response, bool* repeatable = nullptr,
time_t* time = nullptr);
time_t* time = nullptr, bool* jsonString = nullptr);
/**
* Execute a POST request.
@@ -216,10 +219,13 @@ class HttpClient {
* @param repeatable optional pointer to a bool in which to store whether the request should be repeated later on
* (e.g. due to temporary connectivity issues).
* @param time optional pointer to a @a time_t value for storing the modification time of the file, or nullptr.
* @param jsonString optional pointer to a bool value. When returning, it is set to whether the retrieved
* content-type indicates JSON. When true upon entry, content is JSON, and response is a single JSON string, it
* will be de-escaped to a pure string and the value set to false.
* @return true on success, false on error.
*/
bool request(const string& method, const string& uri, const string& body, string* response,
bool* repeatable = nullptr, time_t* time = nullptr);
bool* repeatable = nullptr, time_t* time = nullptr, bool* jsonString = nullptr);
private:
/**