HttpClient send GET data with request

Hi,

Hopefully someone here's used the HttpClient library from: GitHub - amcewen/HttpClient: Arduino HTTP library
and can help me. I'm using an Ethernet shield and am activating relays depending on the response from the web server.

I'm trying to send with the

http.get(kHostname, kPath);

some additional data:

kPath2="?temp=";
  kPath2.concat(readTemp());
  Serial.println(kPath2);

I'm then trying to kPath2 to the end of the kPath variable. however when i do i get the following error:

error: no matching function for call to 'HttpClient::get(const char [26], String&)'

It would not surprise me that i'm going about this the wrong way however I would appreciate some guidance.

Thanks.
Chris

The library probably does not like the String data type.

error: no matching function for call to 'HttpClient::get(const char [26], String&)'

I don't know why you are sending an array rather than a pointer to an array in the first parameter.

Hi,

i'm using the char array as it was in an example script I am expanding.

Thanks for the pointer about it not liking String. I worked arround this issue using.

string.toCharArray(buf, len)

with this i was able to construct the sring, then convert it to a CharArray, thus sending "GET" data to the webserver :slight_smile: