I'm unfamiliar with cocos2d, but their website has an example of transferring a file via a POST
request (which is the better method for transferring data such as XML).
From the cocos3d-x.org wiki:
cocos2d::network::HttpRequest* request = new cocos2d::network::HttpRequest();
request->setUrl("http://www.httpbin.org/post");
request->setRequestType(cocos2d::network::HttpRequest::Type::POST);
request->setResponseCallback( CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this) );
// write the post data
const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest";
request->setRequestData(postData, strlen(postData));
request->setTag("POST test1");
cocos2d::network::HttpClient::getInstance()->send(request);
request->release();
In this example they're using the postData
string as the data; you'll want to replace this with the XML contents.
In addition you should include these standard headers:
Content-Type: application/xml; charset=utf-8
to indicate the type of data and it's encoding
Content-Length: 12389128
to show the length, in bytes, of the attached data
You could also explore basic compression, which should significantly shrink the XML.