一.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访问接口,响应实例如下:

最新文章

  1. iOS开发——高级篇——二维码的生产和读取
  2. DragSelectRecyclerView 长按滑动多选图像android特效
  3. 安卓开发笔记——深入Activity
  4. coco2dx加载网络图片并保存
  5. JAVA项目JDK版本修改
  6. 2. MySQL
  7. relative和absolute的效果
  8. 【Linux/Ubuntu学习 12】ubuntu下对/etc/profile误修改导致系统不能登录
  9. js中Math()函数&amp;&amp;数据类型转换
  10. delphi 数组类型
  11. Automatic Code Generation--&gt;Implement Interface
  12. linux根下目录详解及分区建议
  13. Oracle --1536错误解决(超出表空间)
  14. Building Your First EDM
  15. Java学习笔记14---this作为返回值时返回的是什么
  16. 转载:原来JavaScript的闭包是这么回事!
  17. ngnix FastCGI解析漏洞
  18. linux kernel driver debug
  19. 黄聪:iOS $299刀企业证书申请的过程以及细节补充
  20. LeetCode——11. Container With Most Water

热门文章

  1. Host Controller transport layer and AMPs
  2. VC++的窗口句柄和窗口ID
  3. mysql drop table命令使用总结
  4. Learning English From Android Source Code:2 Ampersand
  5. caffe搭建--caffe- win10 vs2015 编译(支持GPU)--注意在cmake的时候需要根据情况仔细修改配置
  6. MacBook Pro使用初体验之Mac快捷键汇总(持续更新中)
  7. 一个经典的比喻( 关于TCP连接API )
  8. java中 hashCode() 和 equals()
  9. EasyDarwin开源流媒体服务器提供的RTMP直播推送库
  10. ReentrantLock和Synchronized