Java SpringCloud如何使用端点
对于Spring Boot Actuator应用程序,还有一些额外的管理端点:Java SpringCloud如何使用端点,java,spring,spring-mvc,spring-boot,spring-boot-actuator,Java,Spring,Spring Mvc,Spring Boot,Spring Boot Actuator,对于Spring Boot Actuator应用程序,还有一些额外的管理端点: POST to /env to update the Environment and rebind @ConfigurationProperties and log levels 它工作并返回: { "testprop": "test value" } 但当我发帖时: 不支持请求方法“POST” 我想更新testprop,如何使用API进行更新?我在 对于Spring Boot Actuator应用程序,
POST to /env to update the Environment and rebind @ConfigurationProperties and log levels
它工作并返回:
{
"testprop": "test value"
}
但当我发帖时:
不支持请求方法“POST”
我想更新testprop,如何使用API进行更新?我在 对于Spring Boot Actuator应用程序,还有一些额外的管理端点:
POST to /env to update the Environment and rebind @ConfigurationProperties and log levels
发布到/env以更新环境并重新绑定@ConfigurationProperties和日志级别
/刷新以重新加载引导上下文并刷新@RefreshScope bean
/重新启动以关闭ApplicationContext并在默认情况下禁用重新启动
/暂停和/或继续调用生命周期方法在ApplicationContext上停止和启动
看起来您必须重新发布/env而不是/end/$yourProperty好的,它可以:
必须以空体投递
回应如下:
{
"test": "dasda"
}
您是否尝试过针对/env发布您向我们展示的JSON?我不知道它是如何工作的,但如果我要实现它,我会允许针对/env发布帖子,或者针对/env/$propertyname发布帖子。是的,我尝试过,但可能我做错了什么。我认为你链接的问题中的错误是他针对/management/env而不是/env发布帖子。如果针对/env的发布对您不起作用,我需要一个复制此内容的最小示例,以便我可以快速查看它。当我在i get上调用POST:Request方法“POST”not supportedInteresting时,您能否提供您的应用程序的最小示例?我想看一下: