Spring boot Spring boot restful管理端点返回HTTP/1.1 400错误请求
我正在尝试使用带有以下URL的浏览器访问Spring Boot的管理端点之一:Spring boot Spring boot restful管理端点返回HTTP/1.1 400错误请求,spring-boot,Spring Boot,我正在尝试使用带有以下URL的浏览器访问Spring Boot的管理端点之一:http://localhost:9080/env 这是我的配置: management.port: 9080 management.address: 127.0.0.1 Request URL:http://localhost:9080/env Request Method:GET Status Code:400 Bad Request Request Headers GET /env HTTP/1.1 Host
http://localhost:9080/env
这是我的配置:
management.port: 9080
management.address: 127.0.0.1
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
我总是收到一个400错误请求
错误
以下是完整的输出:
management.port: 9080
management.address: 127.0.0.1
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
有人能帮忙吗?我找到了问题的答案: 为了获得restful管理端点,需要Spring Boot Actuator 任何使用带执行器的Spring Boot的应用程序都启用了这些restful管理端点 编辑:必要的Maven依赖项:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
org.springframework.boot
弹簧靴起动器执行器
执行器附带了/env
端点,这是事实。但这并不能解释400(如果端点不存在,我希望404)。