moco实例
2024-08-30 09:25:22
一.moco模拟接口响应json
moco的下载地址见虫师博客园:https://www.cnblogs.com/fnng/p/7511539.html
foo.json文件内容如下
[
{
"description":"模拟一个post请求",
"request":{
"uri":"/postdemo",
"method":"post"
},
"response":{
"status":,
"json":{
"success":true,
"errorCode":"",
"errorMsg":""
}
}
}
]
启动moco-runner后,用postman访问接口,响应实例如下:
二.moco模拟接口响应xml
foo.json内容如下
[{
"description": "模拟一个post请求",
"request": {
"uri": "/postdemo",
"method": "post"
},
"response": {
"status": ,
"file": "a.xml"
}
}]
a.xml文件中内容如下:
<?xml version="1.0" encoding="UTF-8"?><request><success>true</success><errorCode></errorCode><errorMsg></errorMsg></request>
启动moco-runner后,用postman访问接口,响应实例如下:
最新文章
- iOS开发——高级篇——二维码的生产和读取
- DragSelectRecyclerView 长按滑动多选图像android特效
- 安卓开发笔记——深入Activity
- coco2dx加载网络图片并保存
- JAVA项目JDK版本修改
- 2. MySQL
- relative和absolute的效果
- 【Linux/Ubuntu学习 12】ubuntu下对/etc/profile误修改导致系统不能登录
- js中Math()函数&;&;数据类型转换
- delphi 数组类型
- Automatic Code Generation-->;Implement Interface
- linux根下目录详解及分区建议
- Oracle --1536错误解决(超出表空间)
- Building Your First EDM
- Java学习笔记14---this作为返回值时返回的是什么
- 转载:原来JavaScript的闭包是这么回事!
- ngnix FastCGI解析漏洞
- linux kernel driver debug
- 黄聪:iOS $299刀企业证书申请的过程以及细节补充
- LeetCode——11. Container With Most Water
热门文章
- Host Controller transport layer and AMPs
- VC++的窗口句柄和窗口ID
- mysql drop table命令使用总结
- Learning English From Android Source Code:2 Ampersand
- caffe搭建--caffe- win10 vs2015 编译(支持GPU)--注意在cmake的时候需要根据情况仔细修改配置
- MacBook Pro使用初体验之Mac快捷键汇总(持续更新中)
- 一个经典的比喻( 关于TCP连接API )
- java中 hashCode() 和 equals()
- EasyDarwin开源流媒体服务器提供的RTMP直播推送库
- ReentrantLock和Synchronized