博客
关于我
JAVA接口自动化(八)Mock接口框架
阅读量:214 次
发布时间:2019-02-28

本文共 703 字,大约阅读时间需要 2 分钟。

技术请求示例

1. 带参数的GET请求

请求地址:/turan/test2

请求方法:GET
参数:name=turan, age=25
响应内容:南京终于晴天了

2. 带参数的POST请求

请求地址:/turan/test2

请求方法:POST
表单参数:name=turan, age=25
响应内容:南京终于晴天了

3. 带Cookies的GET请求

请求地址:/get/with/cookies

请求方法:GET
Cookies信息:login=true
响应内容:这是一个需要携带cookies信息才能访问的get请求

4. 带Cookies的POST请求

请求地址:/post/with/cookies

请求方法:POST
Cookies信息:login=true
请求参数:name=huhansan, age=18
响应状态码:200
响应内容:huhansan: success, status: 1

5. 带有Header信息的请求

请求地址:/post/with/headers

请求方法:POST
Header信息:Content-Type: application/json
请求参数:name=王老子, sex=女性
响应内容:王老子: 成功, status: 1

6. 请求重定向

重定向到百度:

请求地址:/redirect
响应重定向地址:http://www.baidu.com

重定向到自定义页面:

请求地址:/redirect/topath
响应重定向地址:/redirect/new

被重定向到的请求:

请求地址:/redirect/new
响应内容:重定向成功啦

转载地址:http://bfji.baihongyu.com/

你可能感兴趣的文章
Node提示:error code Z_BUF_ERROR,error error -5,error zlib:unexpected end of file
查看>>
Node提示:npm does not support Node.js v12.16.3
查看>>
Node搭建静态资源服务器时后缀名与响应头映射关系的Json文件
查看>>
Node服务在断开SSH后停止运行解决方案(创建守护进程)
查看>>
node模块化
查看>>
Node读取并输出txt文件内容
查看>>
node防xss攻击插件
查看>>
noi 7827 质数的和与积
查看>>
NOIp2005 过河
查看>>
NOIP2011T1 数字反转
查看>>
NOIP2014 提高组 Day2——寻找道路
查看>>
NOIp模拟赛二十九
查看>>
NOPI读取Excel
查看>>
NoSQL&MongoDB
查看>>
NoSQL介绍
查看>>
Notepad++在线和离线安装JSON格式化插件
查看>>
notepad如何自动对齐_notepad++怎么自动排版
查看>>
Notification 使用详解(很全
查看>>
NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty()
查看>>
Now trying to drop the old temporary tablespace, the session hangs.
查看>>