Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 7 months ago.
Square brackets not allowed in GET request?
Hi,
HTTPClient is giving me an "Error - ret = -9 - HTTP return code = 0" when using square brackets [] in a GET request:
ret = http.get("http://dummy.server.org/test?id=55&fields[]=name", str, sizeof(str));
A request without square brackets returns fine. Am I missing something or is this really a limitation of HTTPClient library?
Question relating to:
1 Answer
9 years, 7 months ago.
It's not a limitation of the library, it's a limitation of the URL specification, [ and ] are invalid characters. Replace them with %5B and %5D and it should work.