r/javahelp • • Nov 22 '20

Building a Java REST API

Lets start with REST, what is it? REST is an architectual style, which in most cases is based on HTTP protocols to communicate between different services/clients. It’s in it’s simple sense a set of constraints and properties used to define such communication. When HTTP is used the following operations are avalible:

  • GET — Request data from a specified resource (Get relevant posts on your Facebook Wall)

  • POST — Submits data to be processed (e.g save a user in a Database)

  • PUT — For saving or updating a resource on the server

  • DELETE — For deleting a given resource

With the basic understanding of how API’s are used and what operations are available over HTTP, it’s time to look into how such can be implemented. Within large web applications we will often need several API’s in order to process and offer different services like e.g creating users, saving posts and editing of profile information. When web API’s are combined we often refere to them as a Mashup. See the full implementation tutorial at:

https://medium.com/vinsloev-academy/building-a-java-rest-api-9b36b295fa58

31 Upvotes

2 comments sorted by

View all comments

7

u/[deleted] Nov 22 '20

Not sure if you need help of any kind but I'm just gonna say that there are more operations (like PATCH, OPTIONS, HEAD...) and that this library is a good quick solution or something to take a look at for inspiration.