NETWORKING: Reworked PostRequest to a more universal API

This commit is contained in:
Eugene Sandulenko 2019-10-24 17:30:25 +02:00
parent 901118c5cd
commit bbaebe594e
2 changed files with 41 additions and 7 deletions

View file

@ -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;