Skip to content

Latest commit

 

History

History
59 lines (45 loc) · 1.45 KB

README.md

File metadata and controls

59 lines (45 loc) · 1.45 KB

HttpStatusDogs 🐶

Spring starter that provides a perfect description for your server's responses


Build Status

HttpStatusDogs adds to Spring Context Controller Advice that adds to all server responses a header 'StatusDog' with link to an image that properly represents what has actually happened. Link examples:

Usage

To start using HttpStatusDogs, just include the following dependency in your build.gradle

implementation 'dev.fomenko:httpstatusdogs:1.0.0'

or pom.xml file:

 <dependency>
    <groupId>dev.fomenko</groupId>
    <artifactId>httpstatusdogs</artifactId>
    <version>1.0.0</version>
 </dependency>

Example

  @RestController
  class FakeController {
         @GetMapping("/404")
         public String method404(HttpServletResponse response) {
              response.setStatus(404);
              return "Test";
         }
  }

For the given RestController response will be:

HTTP/1.1 404 
StatusDog: https://httpstatusdogs.com/img/404.jpg
Content-Type: text/plain;charset=UTF-8
Content-Length: 5
Date: Tue, 09 Jul 2019 20:42:44 GMT

Test

All images are provided by HttpStatusDogs