From bbaebe594ea7a3b6afac4e40fbb367ed7b679e94 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 24 Oct 2019 17:30:25 +0200 Subject: NETWORKING: Reworked PostRequest to a more universal API --- backends/networking/curl/postrequest.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'backends/networking/curl/postrequest.h') diff --git a/backends/networking/curl/postrequest.h b/backends/networking/curl/postrequest.h index 568979473c..8992d3a1a3 100644 --- a/backends/networking/curl/postrequest.h +++ b/backends/networking/curl/postrequest.h @@ -37,15 +37,23 @@ class PostRequest: public Networking::Request { byte *_postData; int _postLen; + Common::JSONValue *_jsonData; + + Common::String _contentType; - void start(); void responseCallback(Networking::JsonResponse response); void errorCallback(Networking::ErrorResponse error); public: - PostRequest(Common::String url, byte *postData, int postLen, Networking::JSONValueCallback cb, Networking::ErrorCallback ecb); + PostRequest(Common::String url, Networking::JSONValueCallback cb, Networking::ErrorCallback ecb); virtual ~PostRequest(); + void start(); + + void setPostData(byte *postData, int postLen); + void setJSONData(Common::JSONValue *jsonData); + void setContentType(Common::String type) { _contentType = type; } + virtual void handle(); virtual void restart(); virtual Common::String date() const; -- cgit v1.2.3