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.
10 years, 2 months ago.
HTTPClient - Headers and complex Post Data
Hi. I'm using HTTPClient library in mbed to do HTTP GET and POST calls. I want to follow this guide: http://www.sense-iot.com/using-api/getting-started/
I could already implement Step 2 Log In:
map.clear(); map.put("Accept", "application/json"); map.put("username", username); map.put("password", password); HTTPText inText(str, 512); ret = http.post("http://api.sense-os.nl/login", map, &inText);
In this case, Accept should be part of the Header, but it accepts as parameter like username and password.
Now I'm trying to implement Step 3 Create a Sensor, but first of all Accept and X-SESSION_ID must be part of the Header. How to distinguish Header and parameters? Next, I don't know how to send in HTTPClient library that complex Post Data shown in the guide. Any tip?
Thanks.