如何在 WSO2 API 管理器中设置 x-www-form-urlencoded 参数?

How to set x-www-form-urlencoded parameters in WSO2 API Manager?

我有一个 API 参数采用 x-www-form-urlencoded 值。它在 Postman 中工作正常,但我不知道如何在 WSO2 中设置它。

这是我在 Postman 中的 API。在正文部分,我使用 Content/Type: x-www-form-urlencoded 发送数据。这对键的值进行编码。但是我在WSO2中没有看到这样的东西。

我该如何解决? 谢谢

如果部署的 API 基于 OAS 3.x,您可以按照以下步骤编辑 API 定义:

  1. 登录发布者门户(通过浏览https://<host>:<port>/publisher
  2. Select 特定的 API
  3. 导航到 API Definitions 部分
  4. 如下所述编辑相关资源:
  /getorder:
    post:
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                orderid:
                  type: string
                passengerid:
                  type: string
                ordercode:
                  type: string
  1. 保存更改
  2. 现在,如果您尝试从 DevPortal 调用 API,它将提示输入如下所示的字段: