Next step in my JSON (GSON) Java mini project is to request some data from a web service using a Representational State Transfer (REST) API.
The one I choose is the local bus/boat/train company's web service for requesting departure times. However, to be able to use their API I first needed to register at their website, then trying to figure out how to request OAuth2 tokens using Java HttpsURLConnection.
So far I have gotten so far as to get a 400 (bad request) response. I am thinking I am mixing up url parameters and request properties. Will experiment a bit more.
Conclusion so far, debugging this is tricky. Is there a better way than trial and error (yes, I have RTFM, which is unfortunately not up to date)?
The one I choose is the local bus/boat/train company's web service for requesting departure times. However, to be able to use their API I first needed to register at their website, then trying to figure out how to request OAuth2 tokens using Java HttpsURLConnection.
So far I have gotten so far as to get a 400 (bad request) response. I am thinking I am mixing up url parameters and request properties. Will experiment a bit more.
Conclusion so far, debugging this is tricky. Is there a better way than trial and error (yes, I have RTFM, which is unfortunately not up to date)?
Kommentarer
Skicka en kommentar