ETags for REST with Spring 1. Overview This article will focus on working with ETags in Spring, integration testing of the REST API and consumption scenarios with curl. Further reading: Introduction to Spring REST Docs This article introduces Spring REST Docs, a test-driven mechanism to generate documentation for RESTful services… Continue Reading etags-for-rest-with-spring

REST API Discoverability and HATEOAS 1. Overview This article will focus on Discoverability of the REST API, HATEOAS and practical scenarios driven by tests. 2. Why Make the API Discoverable Discoverability of an API is a topic that doesn’t get enough well-deserved attention. As a consequence, very few APIs get… Continue Reading restful-web-service-discoverability

REST Assured Authentication 1. Overview In this tutorial, we’ll analyze how we can authenticate with REST Assured to test and validate a secured API properly. The tool provides support for several authentication schemes: Basic Authentication Digest Authentication Form Authentication OAuth 1 and OAuth 2 And we’ll see examples for each… Continue Reading rest-assured-authentication

Spring JSON-P with Jackson 1. Overview If you’ve been developing anything on the web, you’re aware of the same-origin policy constraint browsers have when dealing with AJAX requests. The simple overview of the constraint is that any request originating from a different domain, schema or port, will not be permitted.… Continue Reading spring-jackson-jsonp

Explore Jersey Request Parameters 1. Introduction Jersey is a popular Java framework for creating RESTful web services. In this tutorial, we’ll explore how to read different request parameter types via a simple Jersey project. 2. Project Setup Using Maven archetypes, we’ll be able to generate a working project for our… Continue Reading jersey-request-parameters

How to Compress Requests Using the Spring RestTemplate 1. Introduction In this short tutorial, we’ll look at how to send HTTP requests containing compressed data. In addition, we’ll look at how to configure a Spring web application so it handles compressed requests. 2. Sending Compressed Requests Firstly, let’s create a… Continue Reading spring-resttemplate-compressing-requests

Authentication Against a REST Service with Spring Security REST Spring Security Authentication RestTemplate Table of Contents 1. Overview 2. The Goal 3. The Client 4. Testing the Authentication Service 5. Conclusion 1. Overview This article is focused on how to authenticate against a secure REST API that provides a RESTful… Continue Reading authentication-against-a-third-party-service