首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在WSO2 Api网关中发布、放置和修补无法工作的资源

在WSO2 Api网关中发布、放置和修补无法工作的资源
EN

Stack Overflow用户
提问于 2020-04-08 17:50:50
回答 1查看 375关注 0票数 0

我对WSO2工具非常陌生。我最近开始使用WSO2 API管理器(Ver)。3.1.0)。我通过导入httpbin swagger规范:https://github.com/Azure/api-management-samples/blob/master/apis/httpbin.swagger.json创建了一个API网关。我发布了API,订阅了它,生成了API键并开始测试。

我在邮递员中导入规范,配置API密钥进行授权,将服务器更改为本地网关http://localhost:8280/Api_Base/1.0

使用GET方法定义的所有资源都是可访问的,但不能通过网关访问POST、PUT和修补程序资源。对于这些资源,我收到了以下错误响应"<faultstring>unknown“。我也尝试过使用cURL,但是得到了同样的结果。当我直接为httpbin尝试POST时,它运行得很好:

代码语言:javascript
复制
curl --location --request POST 'http://httpbin.org/post'
{
  "args": {}, 
  "data": "", 
  "files": {}, 
  "form": {}, 
  "headers": {
    "Accept": "*/*", 
    "Host": "httpbin.org", 
    "User-Agent": "curl/7.58.0", 
    "X-Amzn-Trace-Id": "Root=1-5e8e0d39-ddf21f1055008f60707cf150"
  }, 
  "json": null, 
  "origin": "95.103.xxx.xxx", 
  "url": "http://httpbin.org/post"
}

并通过我的API网关(也使用API密钥):

代码语言:javascript
复制
curl --location --request POST 'http://localhost:8280/HTTP_Bin_Mock/1.0/post'
<faultstring>unknown</faultstring>

有什么会出错的?

EN

回答 1

Stack Overflow用户

发布于 2020-04-11 14:31:44

请尝试以下CURL命令

代码语言:javascript
复制
curl --location --request POST 'http://localhost:8280/HTTP_Bin_Mock/1.0/post' --data '{}' --header 'Content-Type: Application/JSON'
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61106914

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档