esp8266 to web..field update

Hey new to arduino..messing around with the new esp8266..Trying to send temperature data to thingspeak..Have it working to update one field on the channel I setup. Now Im having a problem with code to update two fields at the same time...the following is working to update one field with string tempF. // prepare GET string String getStr = "GET /update?api_key="; getStr += apiKey; getStr +="&field1="; getStr += String(tempF),

I then added the following in order to update 2 fields with two strings...all it does is update field2 only...

// prepare GET string String getStr = "GET /update?api_key="; getStr += apiKey; getStr +="&field1=""&field2="; getStr += String(strTemp), String(tempF);

Just wondering if someone could give me a little guidance..thanks.

Just wondering if someone could give me a little guidance…thanks.

Sure. Print the string you are constructing. You’ll see why it is wrong. After the ? comes a name = value pair, then the & and another name = value pair. That is not what you are constructing.

And, you are misusing the comma operator.

Okay I replaced the code with getStr +="&field1=100&field2=200"; And it updates both fields.. But I want to update with my actual data.. So I tried

getStr +="&field1=String(strTemp)&field2=String(tempF) ";

Didn't work..

Didn't work..

Did something!

You cantik try this code. String getStr = "GET /update?api_key="; getStr += apiKey; getStr +="&field1="+"String(strTemp); getStr +=" &field2="+String(tempF);