wifly GET issue

Hi all,

I really need some help here.

I’m using arduino uno with wifly shield RN-131C. Powered by batteries.

My wifly works with WebClient example on the wifly library 2. I’m using a push-button. where if the button pushed the wifly GET the URL and if its not pushed it GET another URL. The URL will update a php code. my problem is “GET” work only one time (puched button, even if its re-pushed it wont work again) . Is there a way to clear GET to allow sending another URL?

my code is:

void loop() {
if (button == HIGH) {
client.println("GET http://*****.com/****.php?update ");
client.println(" ");
}else {
client.println("GET http://*****.com/****.php?do ");
client.println(" ");
}
}

Thanks,

Nadds

please someone give me a hand over here!

You want:

client.println(“GET http://*****.com/****.php?update HTTP/1.0”);

client.println(“Host: *****.com”);

client.println(“”);

Without the “HTTP/1.0” it’s a HTTP 0.9 request. There are no additional headers with an HTTP 0.9 request (just one line and done). This might be the source of your one-and-done issue.

The second line may or may not be required, but it won’t hurt.

The third line must not include a space as you have in your example – it should be just a “return”. Because you’re sending a space you’re turning it into an invalid HTTP header and never really signaling the end of your request.