Hi all!
I am currently trying to implement basic networking into a project that I am working on, and whilst some code samples (NinjaSnowWar, 16_Chat and 17_SceneReplication) are useful, they make no usage of the HttpRequest as far as I can tell.
I am interested in making my own custom API calls to a server that hosts player information which is retrieved upon logging in, only I cannot seem to find the appropriate syntax for doing so.
Here is some code to show where I am at:
[code]SharedPtr< HttpRequest > response = network->MakeHttpRequest(String(“http://httpbin.org/ip”));
Log *log = new Log(context_);
if (response->GetError() == “”) {
log->WriteRaw(“No error in response”);
std::string dest;
response->Read(&dest, response->GetAvailableSize());
log->WriteRaw("RESP: BEGIN");
log->WriteRaw(String(dest));
log->WriteRaw("RESP: END");
}[/code]
I am basing this code off of the documentation here: http://urho3d.github.io/documentation/1.5/class_urho3_d_1_1_http_request.html
Can anybody help me extract the response from this GET request so that I can use it to access my own custom API?
Currently, I am getting:
No error in response
RESP: BEGIN
RESP: END
Am I perhaps not handling the void pointer correctly?
Thanks!