简体   繁体   English

WSO2 - 不支持的请求方法

[英]WSO2 - Unsupported Request Method

I'm setting up wso2 api manager. 我正在设立wso2 api经理。 The issue is when i request a rest API from wso2 to backend, the request is always GET method irrespective of wso2's request method. 问题是当我从wso2请求一个rest API到后端时,无论wso2的请求方法如何,请求总是GET方法。

The wso2 server hits the backend as GET method even if my requested API is POST method. 即使我请求的API是POST方法,wso2服务器也会以GET方式命中后端。

sample request 样品申请

curl -X POST \
   https://wso2.oasys.co/v1/login \
   -H 'Accept: */*' \
   -H 'Authorization: Bearer 1e258be1-b3f8-304d-8e04-f3af78a400a7' \
   -d '{
"username" : "username",
"password" : "password"
   }'

sample response 样品回复

{
"timestamp": 1556267728729,
"status": 405,
"error": "Method Not Allowed",
"message": "Request method 'GET' not supported",
"path": "/login"
}

How is this specified at the resource level in the API definition ? 如何在API定义的资源级别指定? You can view this either as a swagger.json in the API manager console or as an XML file under \\repository\\deployment\\server\\synapse-configs\\default\\api. 您可以在API管理器控制台中将其视为swagger.json,也可以在\\ repository \\ deployment \\ server \\ synapse-configs \\ default \\ api下查看为XML文件。 I'm using version 2.6.0 as a reference. 我使用的是2.6.0版作为参考。

Does the resource have GET and POST as allowed methods? 资源是否具有GET和POST作为允许的方法? It seems odd that a GET would be sent for a POST request. 看起来奇怪的是,将为POST请求发送GET。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM