https://github.com/michaelfmnk/httpstatusdogs
Spring starter that provides a perfect description for your server's responses
https://github.com/michaelfmnk/httpstatusdogs
dogs fun pet-project spring spring-boot spring-boot-starter
Last synced: 5 months ago
JSON representation
Spring starter that provides a perfect description for your server's responses
- Host: GitHub
- URL: https://github.com/michaelfmnk/httpstatusdogs
- Owner: michaelfmnk
- Created: 2019-07-09T19:31:54.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-05-15T16:26:05.000Z (about 4 years ago)
- Last Synced: 2025-07-25T13:56:21.540Z (11 months ago)
- Topics: dogs, fun, pet-project, spring, spring-boot, spring-boot-starter
- Language: Java
- Homepage:
- Size: 65.4 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HttpStatusDogs 🐶
### Spring starter that provides a perfect description for your server's responses
---
[](https://travis-ci.org/michaelfmnk/httpstatusdogs)
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:
- https://httpstatusdogs.com/img/100.jpg
- https://httpstatusdogs.com/img/200.jpg
- https://httpstatusdogs.com/img/500.jpg
- etc.
### Usage
To start using HttpStatusDogs, just include the following dependency in your `build.gradle`
```groovy
implementation 'dev.fomenko:httpstatusdogs:1.0.0'
```
or `pom.xml` file:
```xml
dev.fomenko
httpstatusdogs
1.0.0
```
### Example
```java
@RestController
class FakeController {
@GetMapping("/404")
public String method404(HttpServletResponse response) {
response.setStatus(404);
return "Test";
}
}
```
For the given RestController response will be:
```http request
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](https://httpstatusdogs.com)