How To Use Ignition Http Classes To Make Get Request?
The documentation for [Ignition][1] is rather sparse. I'm looking at the documentation for the HTTP classes, such as link here, but I'm confused. My current code looks something li
Solution 1:
Use the IgnitedHttp class : link
So,
new IgnitedHttp(context).get("http://www.example.com")
Will return IgnitedHttpRequest object that you can call the send() method on.
See for more info on IgnitedHttpRequest : link
This send() will return an IgnitedHttpResponse object that you can call the getResponseBodyAsString().
See for more info on IgnitedHttpResponse : link
All in all,
new IgnitedHttp(context).get(url).send().getResponseBodyAsString()
Is the answer to your first question. Your 2nd question's answer is that IgnitedHttp also has methods for posts, puts, etc.
here is the sample activity that does a lot of what you may want to do too : https://github.com/mttkay/ignition/blob/master/ignition-support/ignition-support-samples/src/com/github/ignition/samples/support/IgnitedHttpSampleActivity.java
Enjoy using the best piece of code I've found.
Post a Comment for "How To Use Ignition Http Classes To Make Get Request?"