Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
My question is very concise. I have an API from RapidApi and I am looking to make a interactive Web Application. How can I integrate the API into Java in order to get access to all the methods that the API provides? Thank you.
The API will most probably be a REST API. Have a look at https://restfulapi.net/ for background info.
The process of interacting with a REST API is called "consuming" the API.
Basically you just launch a HTTP request to the API, and the result is a JSON data structure.
The details of the HTTP Requests (URL, HTTP methods to use, and data to send), and the JSON return format are documented by the API.
Although it can be done without using any specific framework, it is probably easier with a framework like Spring.
If you know the basic concepts of Spring you could follow one of their guides about this topic: https://spring.io/guides/gs/consuming-rest/
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I need to create vm's in google compute engine. Through google OAuth playground i can create VM, using REST service calls. Same thing i want to do using JAVA as a normal program. For this i have endpoint and request payload. I am not able to understand how we can do OAuth using java. If i pass my gmail credentials in headers Authorization, it is giving like HTTP HTTP Basic Authentication is not supported for this API. Kindly suggest me how i can call those REST endpoint. Please send me step by steps or any sites.
Use the google-api-client library for Java
Use a service
account to authenticate
Never use your username/password in API calls or code !
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I almost finished my RESTful API.
I created the API with PHP and using SLIM Framework.
And for the last step, I should consume the RESTful API that I've created before on Android application.
I've some question to ask.
Is it possible to use the RESTful API that I made with SLIM and PHP in Android Application ?
If the answer is 'YES', is there a framework or library can be used ?
Thanks before :)
You might want to take one of:
Android Async HTTP
Spring
Volley
RESTDroid
RoboSpice
Retrofit
Httpzoid see this answer
(Take a look at the original answer where I took most of the list from)
Yes, is possible. RESTful API is the same regardless of the language used. Just make sure that's work correctly using HTTP methods. Check this tutorial http://spring.io/guides/gs/consuming-rest-android/
I recomend use https://github.com/loopj/android-async-http
For me it's best android rest client library
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
there seems to be many ways to access a REST web service. but different documentation out there states they all have problems and now i am confused what to use.
Here are our options:
HTTPClient - from apache, but deprecated. However Apache does provide some alternative
HttpURLConnection - has bugs in it.
AndroidHttpClient - includes the workaround for a major bug in HttpURLConnection
I really don’t know which one to use from the list above. Is there one which I am missing that I should be using
to access a REST web service ?
Ideally, to access a REST Web service, you use a higher-level library, like Retrofit, that handles more of the work for you.
Otherwise, Google's official recommendation is to use HttpURLConnection.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am new to RESTful web services. so please can anyone guide me how to create one with both client and server using OAuth 1.0.
if possible, please give me some example.
You need to learn them in steps and then integrate. Here are couple of links to help you with that:
Learn how to write RESTful webservice using jersey, very simple tutorial:
http://www.mkyong.com/webservices/jax-rs/jersey-hello-world-example/
Learn how to integrate OAuth with jersey :
https://wikis.oracle.com/display/Jersey/OAuth
Final step : You assembling the knowledge and coming up with RESTful webservice using jersey with OAuth.
While coding it if you get stuck or see horrible exceptions, come back and post them here. You will surely get help when you show the right attitude. Good luck!
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I like the way JAX-RS represent URLs.. and find it very easy to be used.
I am thinking of making the JAX-RS works instead of my Servlets, so I can write some JSPs that interact directly with these RESTful resources ...
What do you think?
It's not a decision about your model programming, is a decision about architecture and requirements of your application.
My first experience with JAX-RS was very positive. I used the framework to provide some server side functionality to a desktop app. But I wouldn't see the value of using REST if you are creating a traditional Web app where each client action results in a new Web page getting loaded by the user's browser. If you are building an AJAX app, then I can see how REST might be cleaner to code than Servlet.
What is the nature of the project?
Actually it doesn't matter servlets or even use PHP/HTML front end as you JAX-RS use HTTP request. I would suggest you to use JAX-RS reference implementation for building RESTful Web services call jersey. It provide more goodies ..