Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Response MIME type for Spring Boot actuator endpoints

I have updated a Spring Boot application from 1.4.x to 1.5.1 and the Spring Actuator endpoints return a different MIME type now:

For example, /health is now application/vnd.spring-boot.actuator.v1+json instead simply application/json.

How can I change this back?

like image 869
kap Avatar asked Feb 20 '17 11:02

kap


People also ask

How do you call an actuator endpoint in a spring boot?

When we add Spring Actuator Dependencies to our spring boot project, it automatically enables actuator endpoints. Add below dependencies to your spring application to enable spring boot actuator endpoints. Now when you will run the application, you will see actuator endpoints being mapped in the logs.

Which of the following are spring boot actuator endpoints?

Actuator endpoints let you monitor and interact with your application. Spring Boot includes a number of built-in endpoints and lets you add your own. For example, the health endpoint provides basic application health information. Each individual endpoint can be enabled or disabled.

How does spring boot integrate actuator?

To enable Spring Boot actuator endpoints to your Spring Boot application, we need to add the Spring Boot Starter actuator dependency in our build configuration file. Maven users can add the below dependency in your pom. xml file. Gradle users can add the below dependency in your build.


1 Answers

The endpoints return a content type that honours what the client's request says it can accept. You will get an application/json response if the client send an Accept header that asks for it:

Accept: application/json 
like image 152
Andy Wilkinson Avatar answered Sep 21 '22 09:09

Andy Wilkinson