REST APIs

REST API Testing with REST-assured

Learn to use REST-assured library to write automated tests for REST API testing with examples, specially useful in BDD style development.

Securing Spring Boot REST API with Basic Auth

Learn to use basic authentication to secure the REST APIs created in a Spring boot application. The secured API will ask for user authentication credentials before giving access to the API response. 1. Maven Dependency The simplest way to add all required jars is to add the latest version of …

Spring Boot HATEOAS Links Example

In this Spring Boot HATEOAS example, we will learn to add HATEOAS (Hypertext as the Engine of Application State) links to resource representations returned from REST APIs in a Spring boot application. 1. What is HATEOAS? HATEOAS is one of the constraints of the REST architectural style first presented by …

Adding Role Based Security with Spring Boot REST APIs

Learn to create JAX-RS 2.0 REST APIs using Spring Boot and Jersey framework, and add role based security using JAX-RS annotations e.g. @PermitAll, @RolesAllowed or @DenyAll. Table of Contents Project Structure Create REST APIs Secure REST APIs with JAX-RS Annotations Write security filter using JAX-RS ContainerRequestFilter Demo Project Structure The …

Create Jersey REST APIs with Spring Boot

Learn to configure and create JAX-RS 2.0 REST APIs using Spring Boot and Jersey framework. This example application uses Jersey’s ServletContainer to deploy the REST APIs.

Building HATEOAS Links with JAX-RS

Learn to build JAX-RS 2.0 HATEOAS links in REST resources using it’s javax.ws.rs.core.Link, javax.ws.rs.core.UriBuilder and javax.ws.rs.core.UriInfo classes.

REST API Security Guide

Knowledge of how to secure REST APIs is as much necessary as writing the APIs themselves. Mostly REST APIs are HTTP protocol-based, and any user having an internet connection can access them, and so can bad users as well. It is crucial to write secure APIs to protect the business. …

Difference between SOAP and REST

Although SOAP and REST- both help building applications based on SOA, yet they are pretty much different. Let us learn few differences.

Produce XML Response with Spring WebMVC Controller

In this Spring REST XML example, I am writing hello world example for REST APIs using Spring REST features. In this example, I will be creating two APIs which will return XML representation of resources. 1. Maven Dependencies Let’s start with runtime dependencies which you will need to write these …

Building HATEOAS Links with RESTEasy and JAX-RS

HATEOAS is a constraint on REST that says that a client of a REST application need only know a single fixed URL to access it. Any and all resources should be discoverable dynamically from that URL through hyperlinks included in the representations of returned resources.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.