ENC28J60 Pushing data to Thingspeak

Hi everyone, I am trying to send the values of temp & hum (the clasic ones) to Thingspeak to get the curve on line, it believe that something is wrong with arduino code cause if I type https://api.thingspeak.com/update?key=YE16TORV0WZ8J495&1=15&2=15 ** in the mozilla url, the curve updates and I also can see it in the incoming data of the channel. This is the arduino code:

**the field names of the channel are named 1 (temp) and 2 (hum), otherwise (eg t and h), dont get it.

#include <UIPEthernet.h>
char server = “http://api.thingspeak.com”;

if (client.connect(server,80)) { IT DOES CONNECT!
Serial.println("-> Connected");
// Make a HTTP request:
client.print( “/update?”);
client.print(“key=”);
client.print(“YE16TORV0WZ8J495”);
client.print("&");
client.print(“1=”);
client.print(str_t);
client.print("&");
client.print(“2=”);
client.print(str_h);
client.println( " HTTP/1.1");
client.print( "Host: " );
client.println(server);
client.println( “Connection: close” );
client.println();
//client.println();
client.stop();
}

Hope someone can give me a hand, thanks for reading and the time!

Greetings,

Luciano

lately it seems I got ansious and then solve it digging copying peastying try & error...here it comes the funtion that makes it kick:

loop{

... updateThingSpeak("1="+String(t, DEC)+"&2="+String(h, DEC)); ... ... ......}

void updateThingSpeak(String tsData)

{

if (client.connect(server, 80))

{

client.print("POST /update HTTP/1.1\n"); client.print("Host: api.thingspeak.com\n"); client.print("Connection: close\n"); client.print("X-THINGSPEAKAPIKEY: "+writeAPIKey+"\n"); client.print("Content-Type: application/x-www-form-urlencoded\n"); client.print("Content-Length: "); client.print(tsData.length()); client.print("\n\n"); client.print(tsData);

lastConnectionTime = millis();

if (client.connected())

{

Serial.println("Connecting to ThingSpeak..."); Serial.println(); failedCounter = 0; }

else { failedCounter++; Serial.println("Connection to ThingSpeak failed ("+String(failedCounter, DEC)+")"); Serial.println(); } } else { failedCounter++; Serial.println("Connection to ThingSpeak Failed ("+String(failedCounter, DEC)+")"); Serial.println(); lastConnectionTime = millis(); } }

cheers