后端服务类型为HTTP的示例

<p>后端服务类型为HTTP的示例如下:</p> <table border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="background-color:#f7f8fa"> <p><span style="font-family:Consolas">info: {description: demo group!, title: demo}</span></p> <p><span style="font-family:Consolas">paths:</span></p> <p><span style="font-family:Consolas">&nbsp; /request/postDemo/{reqPath}:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp; post:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; operationId: caseHttp</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; parameters:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - description: request param in path</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in: path</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name: reqPath</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; required: true</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type: string</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-backend-parameters:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - {location: path, name: backPath}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-example: PA011</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - description: request param in query</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in: query</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name: reqQuery</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; required: false</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default: &#39;111&#39;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type: integer</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-backend-parameters:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - {location: query, name: backQuery}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-example: &#39;111&#39;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - description: request param in header</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in: header</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name: reqHeader</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; required: true</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type: number</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-backend-parameters:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - {location: header, name: backHeader}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-example: &#39;apigateway&#39;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; responses:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&#39;200&#39;: {description: success, x-description: success description}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;400&#39;: {description: failure, x-description: failure description}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; summary: The description of the API!</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-auth-type: AK_SK_AUTH</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-backend: {address: &#39;http://10.10.10.10:8888&#39;, method: ANY, path: &#39;/back/anyDemo/{backPath}/{consPath}/{sysPath}&#39;,timeout: 6000, type: HTTP}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-body-desc: The description of request body</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-constant-parameters:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - {description: constant param in path, location: path, name: consPath, value: &#39;PA011&#39;}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - {description: constant param in query, location: query, name: consQuery, value: &#39;apigateway&#39;}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - {description: constant param in header, location: header, name: consHeader, value: &#39;GroupName&#39;}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-path-match-type: NORMAL</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-request-cors: true</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-request-type: PUBLIC</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-response-content-type: application/xml;charset=utf-8</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-response-failure-result: failure</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-response-success-result: success</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-signature-algorithm: H_MAC_SHA256</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-system-parameters:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - {location: path, name: sysPath, value: PA-AG-RequestId}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - {location: query, name: sysQuery, value: PA-AG-Timestamp}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - {location: header, name: sysHeader, value: PA-AG-APIName}</span></p> <p><span style="font-family:Consolas">swagger: &#39;2.0&#39;</span></p> </td> </tr> </tbody> </table>
以上内容是否解决了您的问题?
请补全提交信息!
咨询·建议

电话咨询 - 7x24 小时

400-151-8800

邮件咨询

cloud@pingan.com

在线客服

7x24 小时,急速解答

工单支持

解决云产品相关技术问题