This REST Assured tutorial will teach you how to make an HTTP POST request and validate the Response. To break it into more detail, you will learn: Make HTTP Post requests with REST Assured, Create JSON Object using the com.google.gson library, Send JSON payload in the body of HTTP Post request, Validate the Response Read the…
Read More REST Assured HTTP Post Request
In this tutorial, you will learn how to retrieve the HTTP header value from an HTTP response while testing your RESTful API using REST Assured. What are HTTP Headers? HTTP headers are a fundamental part of the HTTP protocol, which is the protocol used to transfer data over the web. An HTTP header is a…
Read More Read HTTP Header with REST Assured
In this short tutorial on REST Assured you will learn how to get the entire HTTP Response Body when testing your RESTful Web Service Endpoint. Web Service Endpoint Response Let’s assume we have the following Web Service Endpoint URL and when HTTP GET request is made to this Web Service Endpoint a JSON representation of…
Read More REST Assured Get HTTP Response Body
In this REST Assured tutorial, you will learn how easy it is to test and validate RESTful APIs. REST Assured provides excellent HTTP support, explicit verbs, and actions. We will use REST Assured in this tutorial and the Hamcrest library to perform assertions. REST Assured Maven Dependencies Before laying down examples for this library, we need…
Read More REST Assured Tutorial
In this tutorial, you will learn how to implement pagination in your RESTful Web Services application built with Spring Boot. The code example below will demonstrate how to implement pagination for the API endpoint that returns a list of users. I assume you already have your Spring Boot RESTful Web Service built, but if you…
Read More Pagination Tutorial with Spring Boot REST
This tutorial will teach you how to make your RESTful Spring Boot API endpoint respond with either XML or JSON representation. The client application can request our API endpoint to respond with JSON or XML by including a special HTTP Header called Accept. As a value, the Accept HTTP Header will have either application/json or application/xml. …
Read More Return XML or JSON in Spring Boot Web Service
In this Spring Boot REST tutorial, you will learn how to use the @PostMapping annotation to make your RESTful Web Service Endpoint able to handle HTTP Post requests and read its JSON or XML body payload. If you are also interested in using @GetMapping, @PutMapping and @DeleteMapping annotations, check the following tutorial “@PostMapping, @GetMapping, @PutMapping,…
Read More @PostMapping and @RequestBody Example in Spring Boot REST
In this Spring Boot REST tutorial, you will learn how to use the @RequestParam annotation to read the URL Query request parameters in your Spring Boot Web Services application. I also include a video tutorial here, so you can see it in action. To learn how to read request parameters from the URL request path,…
Read More @RequestParam Example in Spring Boot REST
This tutorial will teach you how to use a @PathVariable parameter to read the path parameter value. I will also include here a video tutorial so you can see how to do it on video. To learn how to read request parameters from a query string, read the @RequestParam example tutorial. Let’s say we have…
Read More @PathVariable Example in Spring Boot REST
For a complete step-by-step video course check this page: RESTful Web Services, Java, Spring Boot, Spring MVC, and JPA To learn how to build RESTful Microservices with Spring Cloud by watching step-by-step video lessons, please check this page: Spring Boot Microservices and Spring Cloud. What is Spring Framework? Introduction to Spring Boot, Create a Simple Web Service…
Read More RESTful Web Services with Spring Boot REST
In this tutorial, you will learn how to add Spring Security to your project so that we can use Spring Security to encrypt user passwords. I assume you already have a project created with Spring Boot, but in case you do not have one, check out my blog post on how to “Create a very…
Read More Encrypt User Password with Spring Security
In this tutorial, you will learn how to create a simple Web Service Project with Spring Boot Intializr and then build and run it. After creating the web service project, we will add additional functionality. So, let’s get started. Multiple Ways to Create a Spring Boot Web Service Project There are three different ways to…
Read More Create a Web Service Project with Spring Boot Initializr
In this blog post, I am going to share with you how to configure Spring Data JPA in a Jersey 2 Container Deployable Web App. Spring Data JPA makes it much easier and more convenient to persist and read data from the database and when I needed to tie together Spring Data JPA and Jersey 2 Web…
Read More Configure Spring Data JPA in Jersey 2 JAX-RS App
With this blog post, I am going to share what I needed to do to make JPA work in my Jersey 2 Web Services App. I have created my Jersey 2 app using the following maven snippet: mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes \ -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.26 I then opened pom.xml and added a few new dependencies which I…
Read More Configuring JPA in Jersey 2 Web App
Adding dependency injection support into Jersey 2 Web Services application that uses HK2 is not very straightforward. So, I created this page to document things I needed to do in my Jersey 2 RESTful Web Services app to make the Dependency Injection work. Hope you will find it useful. Create a new class that extends AbstractBinder. This…
Read More Dependency Injection with HK2 in Jersey and JAX-RS