mirror of
https://github.com/arduino-libraries/ArduinoHttpClient.git
synced 2025-04-19 21:22:15 +03:00
Make WiFiClient and HttpClient global var in example
This commit is contained in:
parent
9f0078440f
commit
94a8723420
@ -25,6 +25,9 @@ const int kNetworkTimeout = 30*1000;
|
|||||||
// Number of milliseconds to wait if no data is available before trying again
|
// Number of milliseconds to wait if no data is available before trying again
|
||||||
const int kNetworkDelay = 1000;
|
const int kNetworkDelay = 1000;
|
||||||
|
|
||||||
|
WiFiClient c;
|
||||||
|
HttpClient http(c, kHostname);
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
//Initialize serial and wait for port to open:
|
//Initialize serial and wait for port to open:
|
||||||
@ -50,9 +53,6 @@ void loop()
|
|||||||
{
|
{
|
||||||
int err =0;
|
int err =0;
|
||||||
|
|
||||||
WiFiClient c;
|
|
||||||
HttpClient http(c, kHostname);
|
|
||||||
|
|
||||||
err = http.get(kPath);
|
err = http.get(kPath);
|
||||||
if (err == 0)
|
if (err == 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user