简体   繁体   中英

A J2EE server collect information of another server, possible?

I'm doing a project. My teacher provides a server having Restful API, but it isn't for android app. I would like to develop another server (by J2EE) which can collect information of my teacher server (by using its Restful API) to provide a Restful API for my androi app. It means that my server provides web service for my android app and it's also client of my teacher server. That's my project idea. I wonder if it's possible with J2EE. If it's possible, how to send and receive HTTP messages by J2EE ? Thank you very much in advanced for your answers.

Being a client to another Restful HTTP service you must use an HTTP client and it isn't really relevant if your application (as client) is developed in a J2EE context or is a standalone console application.

The Apache HttpClient is pretty common and allows you to create your GETs, POSTs, and other verbs directly. It also supports HTTPS and the typical authentication methods. Nevertheless this is a matter of preference and you can also check the answers to a question like HttpClient in java for more opinions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM