我是 GET REQUEST 的服务 urlhttp://myipaddress:5000/api/Tenant/tenants/{TenantID}
将TenantID
是动态的
我也有 POST 作为 http://myipaddress:5000/api/Tenant/tenants
在这篇文章中,请求有效负载在请求正文中传递。
我的网关配置 yml 文件如下
http:
port: 8080
admin:
port: 9876
hostname: localhost
apiEndpoints:
api:
host: localhost
paths: '/ip'
tenant-api:
host: localhost
paths: '/api/Tenant/tenants/*'
serviceEndpoints:
httpbin:
url: 'https://httpbin.org'
tenant-svc:
url: 'http://localhost:5000'
policies:
- basic-auth
- cors
- expression
- key-auth
- log
- oauth2
- proxy
- rate-limit
pipelines:
default:
apiEndpoints:
- api
- tenant-api
policies:
# Uncomment `key-auth:` when instructed to in the Getting Started guide.
# - key-auth:
- proxy:
- action:
serviceEndpoint: httpbin
changeOrigin: true
- action:
serviceEndpoint: tenant-svc
changeOrigin: true
当我尝试通过代理执行 GET 请求时得到 404。你也可以让我知道如何在我的 gatewayconfig.yml 中添加 POST api 端点