1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00

converted to HTTP/1.1 and the client point to the arduino ascii logo

This commit is contained in:
Fede85
2013-04-09 17:33:43 +02:00
parent 34334fca4f
commit afc9ad2663

View File

@ -2,8 +2,8 @@
Web client Web client
This sketch connects to a website through a GSM shield. Specifically, This sketch connects to a website through a GSM shield. Specifically,
this example downloads the URL "http://arduino.cc/" and prints it this example downloads the URL "http://arduino.cc/asciilogo.txt" and
to the Serial monitor. prints it to the Serial monitor.
Circuit: Circuit:
* GSM shield attached to an Arduino * GSM shield attached to an Arduino
@ -34,7 +34,7 @@ GSM gsmAccess;
// URL, path & port (for example: arduino.cc) // URL, path & port (for example: arduino.cc)
char server[] = "arduino.cc"; char server[] = "arduino.cc";
char path[] = "/"; char path[] = "/asciilogo.txt";
int port = 80; // port 80 is the default for HTTP int port = 80; // port 80 is the default for HTTP
void setup() void setup()
@ -72,10 +72,10 @@ void setup()
// Make a HTTP request: // Make a HTTP request:
client.print("GET "); client.print("GET ");
client.print(path); client.print(path);
client.println(" HTTP/1.0"); client.println(" HTTP/1.1");
client.println(); client.print("Host: ");
client.print("HOST: ");
client.println(server); client.println(server);
client.println("Connection: close");
client.println(); client.println();
} }
else else