Problems reading Restful webservice with Wifly

Hi,
I’m trying to read weather data with Wifly shield and getting errors (see below).
The URL work fine in a browser, but does not work when when called from the sketch.
Any thoughts?
Thanks!
Tim

The program (without passwords and API keys)

#include “WiFly.h”
#include “Credentials.h”

Client client(“forecast.io”, 80);

String csvString = “”; // string for incoming serial data

void setup() {
Serial.begin(9600);
WiFly.begin();
Serial.println(“starting connection”);
if (!WiFly.join(ssid, passphrase)) {
Serial.println(“Association failed.”);
while (1) {
// Hang on failure.
Serial.println(“Hanging on failure…”);
}

}
delay(2000);
Serial.println(“connecting…”);
if (client.connect()) {
Serial.println(“connected”);
client.println(“GET http://api.forecast.io/forecast/API Key goes here/38.2458,122.6314”);
client.println();
} else {
Serial.println(“connection failed”);
}

}

void loop() {
if (client.available()) {
char c = client.read();
Serial.print(c);
}

if (!client.connected()) {
Serial.println();
Serial.println(“disconnecting.”);
client.stop();
for(;:wink:
;
}
}

Errors

starting connection
connecting…
connected
HTTP/1.1 301 Moved Permanently
Server: nginx/1.1.19
Date: Sat, 21 Jun 2014 17:56:45 GMT
Content-Type: text/html
Content-Length: 185
Connection: close
Location: https://api.forecast.io/forecast/API Key goes here/38.2458,122.6314

301 Moved Permanently

301 Moved Permanently


nginx/1.1.19

disconnecting.

it's not an error, it's a redirect to https. you'll need HttpClient with ssl support.