Skip to content

Commit 94a8723

Browse files
committed
Make WiFiClient and HttpClient global var in example
1 parent 9f00784 commit 94a8723

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/SimpleHttpExample/SimpleHttpExample.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ const int kNetworkTimeout = 30*1000;
2525
// Number of milliseconds to wait if no data is available before trying again
2626
const int kNetworkDelay = 1000;
2727

28+
WiFiClient c;
29+
HttpClient http(c, kHostname);
30+
2831
void setup()
2932
{
3033
//Initialize serial and wait for port to open:
@@ -50,9 +53,6 @@ void loop()
5053
{
5154
int err =0;
5255

53-
WiFiClient c;
54-
HttpClient http(c, kHostname);
55-
5656
err = http.get(kPath);
5757
if (err == 0)
5858
{

0 commit comments

Comments
 (0)