Search results for: Java

In this tutorial, you will learn how to read HTTP Request Header in the Rest Controller class of your Spring Boot application. To read HTTP Request Header in Spring Boot REST application, we use @RequestHeader annotation. @RequestHeader(value=”Accept”) String acceptHeader To learn how to test if HTTP Header is received, read the tutorial about Testing HTTP Header…

Read More Read HTTP Request Header in Spring Boot REST

In this Swagger tutorial, I am going to share with you how to add Contact and API information to your RESTful Web Service documentation created with Swagger. When adding Swagger to our RESTful Web Service, we usually create a new configuration Java Class which is then annotated with @Configuration annotation. Below is an example of…

Read More REST API Contact and ApiInfo with Swagger

If your project uses Spring Security and you have added Swagger/OpenAPI to it, there is a little additional configuration you need to do in order to make your /v3/api-docs and swagger-ui.html pages work. Enable Swagger URLs in Spring Security Project To enable Swagger URLs in a RESTful Web Services project built with Spring Boot and…

Read More Swagger/OpenAPI and Spring Security

In this tutorial, you will learn how to add Swagger or an OpenAPI support to your Spring Boot project so that you can start documenting your REST API. To be able to follow this tutorial you will need to have your REST API Spring Boot project created. If you do not have one, here is…

Read More How to Add Swagger to a Spring Boot REST API Project

In this tutorial, you will learn how to deal with an infinite recursion problem or circular reference, which occurs when you try to return an Object with Bidirectional Relationships in the HTTP response body. Infinite Recursion Problem Let’s look at an example that will cause an Infinite Recursion problem in our RESTful Web Service when we…

Read More Infinite Recursion in Objects with Bidirectional Relationships

This tutorial will teach you how to create a JPA Native SQL Query to only select information from specific columns. You can find many more Spring Data JPA-related tutorials on this site. Some of the most popular tutorials are: One-to-One Mapping Hibernate/JPA Using Spring Boot and MySQL One-to-Many Mapping Hibernate/JPA Using Spring Boot and MySQL…

Read More Select Specific Columns with JPA Native Query

In this blog post, I am going to list commonly used POM.XML dependencies for building RESTful Web services with Spring Boot and Spring MVC. The list of below dependencies is not complete and will depend on the functionality you need your RESTful Web Services to support. But if you are building a simple REST API…

Read More Common POM.XML Dependencies for RESTful Web Services

I hope you do find these video lessons helpful. There are many more video lessons that I have recorded and packaged into a single video course. Please check out my video course below if you want to learn how to do Unit Testing and Integration Testing of Java applications.

Read More Testing RESTful Web Services

The list of below video tutorials is a Quick Start to learning How to Build RESTful Web Services with Spring Framework. Spring Framework is large and there is so much to learn about it. And although there are so many tutorials on the Internet I still felt it would be helpful to create a series…

Read More RESTful Web Services with Spring Framework. Video Tutorials

In this tutorial on Rest Assured, I am going to share with you how to create a test case which sends HTTP Get Request and includes two Query String Request Parameters. Let’s assume we need to test a RESTful Web Service Endpoint which returns a list of users. The URL to our RESTful Web Service…

Read More Rest Assured HTTP Request with Query Parameters

In this tutorial, you will learn how to validate the request body of an HTTP Post request sent to a RESTful Web Service endpoint built with Spring Boot. Request Body JSON Let’s say you have a RESTful Web Service endpoint that accepts HTTP post requests with the following JSON payload: { “firstName”: “Sergey”, “lastName”: “Kargopolov”,…

Read More Validate Request Body in RESTful Web Service