Creating Your REST Controller & Using Postman to Test Resources

Donovan
4 min readFeb 6, 2022

part 3 in a full stack series

In Implementing JpaRepository for CRUD capabilities in your Spring Project we created our repository interface and service class. Now we need to make sure that we will be able to use the methods we defined when we begin to test using Postman.

This tutorial will walk through creation of a REST controller and the workings that Spring will do in order to build a RESTful web service. Then, looking ahead; a demo of using Postman to facilitate POST, READ, UPDATE and DESTROY methods, or, crud functions.

Postman is an API platform for building and using APIs. In it you can send requests to resources and be returned a result. We will learn how to create a controller to handle requests and create errors if a request was unable to be completed. Let’s get started in the application.

Information will be returned based on the type of request from a client. These will be requested via user interactions, which we will see how to build when we start the front end development. Before our application can handle requests and retrieve information we need to create our REST controller.

To understand what a REST controller is we need to understand what a REST web service is. REST is a web building style that defines functions and data as resources and provides operations that allow you to act on that data. Every resource is identified through its on URI, uniform resource identifier, usually a…

--

--

Donovan

Learning. Puttin up shots in Angular and Java and Python and anything else I get my hands on. Sights set on becoming a gainfully employed developer.