Ajax课程的API接口


04-表单提交

<p><strong>简要描述:</strong> </p> <ul> <li>测试以 POST 方式提交 form 表单到服务器</li> </ul> <p><strong>请求URL:</strong> </p> <ul> <li><code>/api/data</code></li> </ul> <p><strong>请求方式:</strong></p> <ul> <li>POST </li> </ul> <p><strong>数据:</strong> </p> <ul> <li>可根据自己的需求,按需提供<strong>任何表单数据</strong></li> <li>键值对,username=admin&amp;password=123456</li> <li>对象,{ username: 'admin', password: 123456 }</li> </ul> <p><strong>返回示例:</strong></p> <pre><code>{ "message": "提交成功,Content-Type: application/x-www-form-urlencoded", "data": { "username": "admin", "password": "123456" } } </code></pre> <p><strong>返回参数说明:</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">message</td> <td style="text-align: left;">string</td> <td>服务器返回的消息提示</td> </tr> <tr> <td style="text-align: left;">data</td> <td style="text-align: left;">object</td> <td>客户端通过 POST 方式提交到服务器的 form 表单数据</td> </tr> </tbody> </table>

页面列表

ITEM_HTML