0

I came here to ask my question after searching for 2 days !! My question is about REST api call and POST request on my api. I have already seen tutorial in JAVA about creating a httpclient in my side with httpsURLConnection to connect to the api and I did a POST request. It works for instance with https://www.example.com. BUT it did not work for the case below.

Case: (I have to do that in JAVA with eclipse) The REST API is accessible at https://test.api.kolibree.com. I get a client_id (=5) and a client_secret (= X7doOhLCRbuT0FIgBsmy) to access the API. First, to make an API call, I need to provide the http-x-client-idand http-x-client-sig headers. http-x-client-sigis computed using the absolute url of the request. (I managed to compute it)

Secondly: to connect to a Kolibree account using an email and a password, make a POST request to v1/accounts/request_token/ with body arguments email (=android.test@kolibree.com) and password (=test).

Problem: I don't know how to handle the client id and signature headers to do an API call. I haven't seen any tutorials talking about that. Furthermore, how to handle the email and password to do a POST request.

Thanks a lot for your kind attention. I would be infinitely thankful.

Alex

alex
  • 1
  • I'm afraid you overloaded your question with unnecessary details without providing the important ones. There are not many people around who know what is kolibree and how to use their protocol. So I suggest you reformulate your question: is your problem with specifying HTTP headers when doing POST with Apache HttpClient? – Alex Nevidomsky Feb 14 '15 at 11:19
  • [See here](http://stackoverflow.com/a/28472044/2587435) – Paul Samsotha Feb 15 '15 at 01:07

1 Answers1

0

Would this be an example of doing HTTP POST with parameters?

https://hc.apache.org/httpcomponents-client-ga/quickstart.html

Alex Nevidomsky
  • 668
  • 7
  • 14