essaye avec ça :
/*
Web client
This sketch connects to a website (http://www.google.com)
using an Arduino Wiznet Ethernet shield.
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
created 18 Dec 2009
by David A. Mellis
*/
#include <Ethernet.h>
#include <PString.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = {
192,168,0,177 };
byte server[] = { 217,107,214,2 }; // jfsgeneva.com
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
Client client(server, 80);
String stringOne = "";
long echec=0;
void setup() {
// start the Ethernet connection:
Ethernet.begin(mac, ip);
// start the serial library:
Serial.begin(9600);
// give the Ethernet shield a second to initialize:
delay(1000);
// Serial.println("connecting...");
// if you get a connection, report back via serial:
}
void loop(){
Serial.println("connecting...");
if (client.connect()) {
// client.flush();
// Serial.flush();
Serial.println("connected");
// Make a HTTP request:
client.print("GET http://monsite.com/test/?turlututu");
client.println(" HTTP/1.1");
client.print("Host: monsite.com\n");
client.print("Referer: http://monsite.com\n\n");
client.println();
delay(200);
}
else if (!client.connected()){
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
// if there are incoming bytes available
// from the server, read them and print them:
if (client.available()!=0) {
int b=client.available();
for (int a=0; a < b+1000;a++){
char c = client.read();
// Serial.print(c);
String stringOne += c;
// Serial.flush();
}
Serial.println(String stringOne);
// client.flush();
Serial.flush();
//client.stop();
}
// if the server's disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
Serial.println();
Serial.println();
client.flush();
Serial.flush();
client.stop();
// do nothing forevermore:
// for(;;)
// ;
}
delay(2000);
}