curl -X post http://localhost:8888/bus/refresh throws HttpRequestMethodNotSupportedException "post"

在用Spring Cloud Bus、kafka实现config-server自动刷新配置的时候,执行命令:

curl -X post http://localhost:8881/bus/refresh

报如下错误:

{"timestamp":1513070184793,"status":405,"error":"Method Not Allowed","exception":"org.springframework.web.HttpRequestMethodNotSupportedException","message":"Request method 'post' not supported","path":"/bus/refresh"}campus-080-239

最后发现了一个很低级的错误,就是把post小写了,应该改成大写:

curl -X POST http://localhost:8881/bus/refresh

更多系列文章推荐:

  1. Spring Cloud (20) | Spring Cloud Bus 使用kafka消息总线、gitlab添加webhooks实现自动刷新配置
  2. Spring Cloud (19) | Eureka Server 高可用服务注册中心
  3. Spring Cloud (18) | 给Eureka Server加上安全验证
  4. Spring Cloud (15) | Spring Boot、HikariCP、Mybatis和MySQL 配置HikariCP数据库连接池
  5. Spring Cloud (14) | 微服务不能从git/github/gitlab中获取数据库信息 can’t load properties from git/github/gitlab
  6. Spring Cloud (12) | Spring Cloud Zuul网关调用微服务,request请求参数是application/json
  7. Spring Cloud (11) | healthcheck开启健康检查
  8. Spring Cloud (10) | Eureka 各项参数详解
  9. Spring Cloud (8) | 把Spring Boot项目改造成tomcat容器启动
  10. Spring Cloud (7) | Mongodb 微服务
  11. Spring Cloud (6) | spring cloud zuul 跨域问题No ‘Access-Control-Allow-Origin’ header
  12. Spring Cloud (5) | 配置中心 Config Server 配置git or github or gitlab
  13. Spring Cloud (3) | spring cloud bus 消息总线kafka应用
  14. Spring Cloud (1) | java.net.UnknownHostException: eureka-server

你可能感兴趣的:(spring-cloud,kafka-消息发布与订阅,curl-shell-命令,Spring,Cloud)