Sending and Receiving XML to/from the web.

Hey guys!

I am busy making a showcase application which has to communicate with a API. This API needs to receive an XML request and will give an XML response with data in return.

The thing is, I’m able to make a nice xml_document in openFrameworks, but I have no idea how to send my XML request to the URL of the API.

In psuedo code it would be something like this:

  
  
void testApp::setup(){  
httpObject.data = xml_document;  
httpObject.send("[http://url-of-the-api.com/",](http://url-of-the-api.com/",) getResponse);  
}  
  
void testApp::getResponse(ofxHttpResponse &response){  
// do stuff with the xml response  
}  
  

I did find the ofxHttpUtil addon and am able to call a URL (eg. twitter), and parse the incoming xml. But I have no clue whatsoever how to send my XML as a POST-action to the given url.

Can anybody help me out? Thanks in advance!

using ofxHttpUtil you can set the method as post, just create an ofxHttpForm with the data set the method as POST and send it.