0

假设我将这些函数映射到端口 8080 上的 web:

/uppercase
/toChars

我可以使用以下方法从他们那里获取数据:

curl -d '["test"]' localhost:8080/uppercase,toChars -H "Content-Type: application/json"

现在我使用网关创建了一个路由来映射:

/uppercase,toChars

但是当我像上面那样运行 curl 时(将端口更改为 8081,因为网关在 8081 上),它不会给我返回请求的信息。我也试过了/uppercase|toChars。这是我正在使用的定义:

spring:
  cloud:
    gateway:
      routes:
        - id: app8080
          uri: http://localhost:8080
          predicates:
            - Path=/uppercase,/toChars

我尝试了不同的组合,Path但都没有奏效。有什么帮助吗?

4

0 回答 0