Simplify sample code.

This commit is contained in:
cosmy 2016-05-23 17:16:15 +02:00
parent 1b661b8a9b
commit 2b1118528b
3 changed files with 2 additions and 5 deletions

View File

@ -84,9 +84,6 @@ void HttpRequestDemo::HandleUpdate(StringHash eventType, VariantMap& eventData)
{
Network* network = GetSubsystem<Network>();
if (!network)
return;
if (httpRequest_.Null())
httpRequest_ = network->MakeHttpRequest("http://httpbin.org/ip");
else

View File

@ -46,7 +46,7 @@ end
function HandleUpdate(eventType, eventData)
-- Create HTTP request
if httpRequest == nil then
httpRequest = network:MakeHttpRequest("http://httpbin.org/ip", "GET")
httpRequest = network:MakeHttpRequest("http://httpbin.org/ip")
else
-- Initializing HTTP request
if httpRequest.state == HTTP_INITIALIZING then

View File

@ -50,7 +50,7 @@ void HandleUpdate(StringHash eventType, VariantMap& eventData)
{
// Create HTTP request
if (httpRequest is null)
httpRequest = network.MakeHttpRequest("http://httpbin.org/ip", "GET");
httpRequest = network.MakeHttpRequest("http://httpbin.org/ip");
else
{
// Initializing HTTP request