Simplify sample code.
This commit is contained in:
parent
1b661b8a9b
commit
2b1118528b
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user