postman介绍:
- postman 可以保持登陆状态(可以模拟登陆)
如何在request或session中存储对象??
例如在request中存储对象的程序较难模拟执行,可以采用:不动态获取参数,而是写死
bug总结:
1、调用接口时,无法访问具体接口 (虽然参数传对了)?
要是这种格式的
注意:? 和参数之间不应该有空格
2、localhost 与 127.0.0.1 , postman是有区分的
3、导出接口的请求方式要为GET
4、日期参数 ,可以用时间戳(string) 进行接收
参数为对象,使用get方式请求:
如果请求对象为复杂的对象,使用post方式:
public Object addProduct(HttpServletRequest request, @RequestBody ProductRequest productRequest,Integer pageSize, Integer pageNum)
{ "shopProduct":{ "productCategory":"类型1", "productName":"product1", "recommendStatus":0, "purchaseType":"111", "productCovers":"xxxx", "productDescription":"描述" }, "shopProductItemList":[ {"itemName":"11","itemRemark":"备注","buyMoney":"12","convertIntegral":"20", "buyConvert":"11+12","itemInventory":100,"itemPicture":"图片" }, {"itemName":"12"} ] }
测试导出接口:(注意:导出接口一定要是get方式)
测试文件上传接口:
https://juejin.im/post/5c860b40e51d453c18649d8d