balteo
balteo

Reputation: 24679

Spring boot restful management endpoint returns a HTTP/1.1 400 Bad Request

I am trying to access one of Spring Boot's management endpoints using a browser with the following URL: http://localhost:9080/env

Here is my config:

management.port: 9080
management.address: 127.0.0.1

I always get a 400 bad request error...

Here is the full output:

Request URL:http://localhost:9080/env
Request Method:GET
Status Code:400 Bad Request

Request Headers
GET /env HTTP/1.1
Host: localhost:9080
Connection: keep-alive
Cache-Control: max-age=0
Authorization: Basic dXNlcjo0YWI0ZDRjMi1mYmIyLTQxYmYtODc0MS04YTk3YWQwZDE3ZWI=
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: fr-FR,fr;q=0.8,en;q=0.6,es;q=0.4,en-GB;q=0.2
Cookie: JSESSIONID=0A00A8C2431F58BF6CD3A9F12822820C

Response Headers
HTTP/1.1 400 Bad Request
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Language: en
Content-Length: 968
Date: Wed, 05 Mar 2014 14:09:13 GMT
Connection: close

Can anyone please help?

Upvotes: 1

Views: 1288

Answers (1)

balteo
balteo

Reputation: 24679

I found the answer to my question:

In order to get the restful management endpoints one needs Spring Boot Actuator.

Any app using Spring Boot with Actuator has those restful management endpoints enabled.

edit: necessary Maven dependency:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

Upvotes: 1

Related Questions