Problems using ethernet

I have a project that reads the network configuration from a sdcard. Then each time I push a button a request to a webserver is made.
The problem is I cant use vars instead of hardcoding values to make the calls.
This works perfectly:

client.println("GET /ticket_call?station=1&return_format=text&get_number_only=1&queue=A HTTP/1.0");
client.println("Connection: close");
client.println("");

When I try to use vars to substitute the A in the queue and the 1 on the station the call dont work.

For the queue I tried to use the following code:

String Queue;
Queue="A";
String request = "GET /ticket_call?station=1&return_format=text&get_number_only=1&queue=";
request += Queue;
request += " HTTP/1.0";
client.println(request);
client.println("Connection: close");
client.println("");

What is wrong? Any help please?
Thank you in advance.

Antonio Teixeira

String Queue;
Queue="A";
String request = "GET /ticket_call?station=1&return_format=text&get_number_only=1&queue=";
request += Queue;

Serial.print("1#");
Serial.print(request);
Serial.println("#");
Serial.println();

request += " HTTP/1.0";

Serial.print("2#");
Serial.print(request);
Serial.println("#");

client.println(request);
client.println("Connection: close");
client.println("")

Make visible what you are really adding to the String

Thank you Stefan,
For some reason I didnt understand all started to work. The concatenated strings are now working fine. Thank you anyway for you answer.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.