Skip to content

Commit e82ab0d

Browse files
author
Tom Igoe
committed
UpUpdatedWifiWebClient
1 parent 1e2a51a commit e82ab0d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

WiFi/examples/WifiWebClient/WifiWebClient.ino

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
1717
created 13 July 2010
1818
by dlf (Metodo2 srl)
19-
modified 4 Mar 2012
19+
modified 9 Mar 2012
2020
by Tom Igoe
2121
*/
2222

@@ -29,7 +29,7 @@ char pass[] = "password"; // your network password (use for WPA, or use as ke
2929
int keyIndex = 0; // your network key Index number (needed only for WEP)
3030

3131
int status = WL_IDLE_STATUS;
32-
IPAddress server(74,125,115,105); // Google
32+
IPAddress server(173,194,43,18); // Google
3333

3434
// Initialize the Ethernet client library
3535
// with the IP address and port of the server
@@ -56,7 +56,9 @@ void setup() {
5656
if (client.connect(server, 80)) {
5757
Serial.println("connected to server");
5858
// Make a HTTP request:
59-
client.println("GET /search?q=arduino HTTP/1.0");
59+
client.println("GET /search?q=arduino HTTP/1.1");
60+
client.println("Host:www.google.com");
61+
client.println("Connection:close");
6062
client.println();
6163
}
6264
}
@@ -65,7 +67,7 @@ void setup() {
6567
void loop() {
6668
// if there are incoming bytes available
6769
// from the server, read them and print them:
68-
if (client.available()) {
70+
if (client.available()>0) {
6971
char c = client.read();
7072
Serial.print(c);
7173
}

0 commit comments

Comments
 (0)