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, 2 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:
![](/media/cache/profiles/266dc8d468ccd5a7def18714b2647e92.jpg.50x50_q85.jpg)
1 Answer
9 years, 1 month 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.