400 Bad Request
Posted:
Thu Sep 24, 2015 9:12 am
by swat_heliket
Hello. I am using ESP8266 for my project. But i have problem. When i send data by manual this is good very well. But when i do the same step by step but use TM4C123 i have 400 Bad Request. i think problem from \n\r. Here is my code in C.
UARTprintf("GET /channels/24430/feeds/last?key=MUIUX8IZ5YNT0OTG");
UARTprintf("\r\n");
any one met this case before plese help.
Thank a lot.
Re: 400 Bad Request
Posted:
Thu Sep 24, 2015 10:00 am
by martinayotte
Most servers rely on HTTP/1.1 not HTTP/1.0. So you need to have more stuff in the header similar to that :
Code: Select allUARTprintf("GET /channels/24430/feeds/last?key=MUIUX8IZ5YNT0OTG HTTP/1.1\r\n");
UARTprintf("Host: thehostname.com\r\n");
UARTprintf("\r\n");
Re: 400 Bad Request
Posted:
Thu Sep 24, 2015 7:28 pm
by swat_heliket
Thank you for your support. I do folow your step but it still dit work. No i dont recive Bad Request anymore. Now. It only busy and SEND Ok.
Any ideal?
Re: 400 Bad Request
Posted:
Fri Sep 25, 2015 3:37 am
by Barnabybear
Hi, you need to leave 15 seconds between requests to the thingspeak server, any less than that and it responds with an error.
Your post doesn't give any indication of timing so that may not be relevent.