简体   繁体   中英

Making A restful API using Java that returns a JSON object as a response

I want to make a RESTful API using Java, that can accept more than one parameter. The API should return some JSON data depending on what the client wants to see. Which is the best place I can start learning from? How is the data stored on the server -- is it inside a big JSON file or is it in a proper database?

Check out Spring Framework and the RestController.

https://spring.io/guides/gs/rest-service/

With Spring, you create POJO's and it automatically converts them to JSON for you. You can either build your POJO manually, or build it from a database using a framework like Spring Data.

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