TCP Socket API trying ti insert values but wont work

23 Aug 2012

this code works

sock.connect("nimbits1.appspot.com", 80);
char http_cmd[] = "GET http://nimbits1.appspot.com/service/batch?p1=test&v1=100&p2=test2&v2=100&email=mav@gmail.com&format=double&secret=1234567 HTTP/1.1\r\nHost: %s\r\n\r\n ";

sock.send(http_cmd, sizeof(http_cmd) - 1);
sock.close();

this works perfect and sends value V1 and value V2 to nimbits (like pachube)great but i want to send reading from the ADC

so I try

sock.connect("nimbits1.appspot.com", 80);
    

int n;
char http_cmd[]="";


n=sprintf (http_cmd, "GET http://nimbits1.appspot.com/service/batch?p1=test&v1=%.1f&p2=test2&v2=%.1f&email=mav@gmail.com&format=double&secret=1234567 HTTP/1.1\r\nHost: %s\r\n\r\n ",orp.read(),tmp.read());

sock.send(http_cmd, sizeof(http_cmd) - 1);

which doesn't work i think i might have to do with 'nHost: %s' Anyone got any ideas

If i printf http_cmd it looks like a valid request, but i must be missing summin. The ADC declares are all right as i am printin them to an LCD before sending the values.