全部 ApiPost使用 后端 前端 接口测试 IOS Android 数据库 2022 测试技术 工具
问答 / 问答详情

v8.0.9 自定义执行脚本-》发送一个请求功能生成的代码有BUG

ApiPost使用 83次浏览

生成的代码

await $.ajax({
    "url":"https://echo.apipost.cn/token.php",
    "method":"POST",
    // 这里有 BUG,ContentType值不对
    "content-type":"appication/json",
    "data":JSON.stringify({
        "email":"admin@admin.com", 
        "password":"密码"
    }),
    "success":function(response){
        response = typeof response == "object" ? response : JSON.parse(response);
        console.log(response);
        apt.variables.set("token", response.token);
    }
});

其中,content-type 为 appication/json,正确的值应为:application/json

| 0 收藏

2 个回答

response打印这个看看

感谢

Apipost 私有化火热进行中

撰写答案

只服务于

前后端、移动端、测试人员

提问题 发布您遇到的Bug和问题,上万名大牛和开发者来帮您解决!