Created
July 11, 2012 11:55
-
-
Save joernroeder/3089915 to your computer and use it in GitHub Desktop.
RequestHandler.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* RequestHandler.h | |
* appConnector | |
* | |
* Created by Jonathan Pirnay & Jörn Röder. | |
* Copyright 2012 jj. All rights reserved. | |
* | |
*/ | |
#include "ofMain.h" | |
#include "ofxJansson.h" | |
#include "ofxHttpUtils.h" | |
#ifndef REQUESTHANDLER_H_INCLUDED | |
#define REQUESTHANDLER_H_INCLUDED | |
class RequestHandler { | |
public: | |
void init(string appKey); | |
json_t* setup(); | |
void exit(); | |
void setDescription(json_t* desc); | |
void setDebugResponse(bool val); | |
bool getDebugResponse(); | |
void post(json_t* values); | |
string get(json_t* obj); | |
int getInterval(); | |
private: | |
string getRequest(string url); | |
string postRequest(json_t* obj, string url); | |
string postResponse(ofxHttpResponse &response); | |
json_t* addAppKey(json_t* values); | |
string appKey, protocol, host, postUrl, descUrl, getUrl, setupUrl; | |
int port; | |
bool _debugResponse; | |
ofxHttpUtils httpUtils; | |
}; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment