Skip to content

Instantly share code, notes, and snippets.

@jmsaavedra
Last active December 7, 2015 07:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmsaavedra/e1d61d6b747ad3762584 to your computer and use it in GitHub Desktop.
Save jmsaavedra/e1d61d6b747ad3762584 to your computer and use it in GitHub Desktop.
cURL POST Request with ofSystem from openFrameworks
string completeUpdate = "{\"requests\": [{\"method\": \"PUT\",\"path\": \"/1/classes/"+dbName+"/"+displayObjectId+"\",\"body\": "+ updateObj + "},{\"method\": \"PUT\",\"path\": \"/1/classes/"+dbName+"/"+displayObjectId+"\",\"body\": " + updateObj2 + "}]}";
string someId = "someIdString";
pushData(someId, completeUpdate);
void pushData(string someIdStr, string updateObjectStr){
cout << "updating parse. objectId: "<<someIdStr<<endl;
cout << "\tupdate object: "<<updateObjectStr<<endl;
string cmd = "curl -X POST \
-H \"X-Parse-Application-Id: QKfYTmyApplicationIdyeadCeakCmfwa\" \
-H \"X-Parse-REST-API-Key: cGN5GZgtOYuf2myRESTApiKeya1t1OaszbNB\" \
-H \"Content-Type: application/json\" \
-d '"+updateObjectStr+"' \
https://my.apiserver.com/1/batch";
ofSystem( cmd );
}
@JesseScott
Copy link

Any thoughts on a GET request ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment