HTTP client is giving wrong results..

hello there,

I have a java server on local host, that sets the status of LCD either 0 or 1. the resource URI is: http://localhost/mytrain/restserver/train/lcd and the content of the page is: {"lcdStatus": 0} or {"lcdStatus":1}

I'm trying to make my Arduino HTTP client reads it, and depending on the value 0 or 1 to control an LCD. But it's not working.. When it gives an answer, then it's ÿ

Could anyone please help me here? what should I write in the GET request? My Arduino is Mega 2560, with Ethernet shield

thanks in advance

post your code

localhost = is an internal loopback device address, you must use the external NIC number, e.g.

give it a try

thanks, you're right.. However I must enter credentials, user name and password.. How to do this in Arduino code?


Google for POST (although it can need another protocol)

thanks! great idea! didn't know that one could use POST in Arduino! I found this.. I'll see how I can use it in my code..