简体   繁体   English

如何在 wso2 api 管理器中处理内容长度 header

[英]How to handle content-length header in wso2 api manager

currently i am using API Manager 4.0目前我正在使用 API Manager 4.0

If there is a content-lengh header in the Post Method, how can I set it up and test the API in the "try out" tab?如果 Post Method 中有 content-lengh header,我该如何设置它并在“试用”选项卡中测试 API? I need help.我需要帮助。


method: POST 方法:POST
url: http://apihostip/GetPut?TYPE=GET&CLA=STRK url: http://apihostip/GetPut?TYPE=GET&CLA=STRK
content: 内容:
:HEADER :HEADER
TABLE=VERSION 表=版本
VERSION 版本
STRING 细绳
1.00 1.00
TABLE=VALID_OPER 表=VALID_OPER
SERIAL_NUM SERIAL_NUM
STRING 细绳
ABCDEDF ABCDEDF



But when try it out, come out the 411 error但是当尝试它时,会出现 411 错误

Thanks.谢谢。

From the API Publisher you can add a header to the resource.从 API Publisher,您可以将 header 添加到资源。

  1. Go to the API and click API Configurations under Develop section. Go 到 API 并单击“开发”部分下的 API 配置。
  2. Click on the Resources.点击资源。
  3. Go the resource and add parameters. Go 资源并添加参数。
  4. From the parameters, click the Header type and fill the rest.从参数中,单击 Header 类型并填写 rest。
  5. Deploy the API.部署 API。
  6. When you are trying out the API from the Swagger UI, it shows the header and you can provide any value to that header.当您从 Swagger UI 试用 API 时,它会显示 header,您可以为该 Z09949399540DBE331 提供任何值。

在此处输入图像描述

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

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