postman 模拟form Post 测试传入List<String>参数方式

1.postman测试传入List<String>参数方式  

http://www.zzvips.com/article/206812.html

 

2.关于postman的form-data如何传递数组形式 

https://blog.csdn.net/chrispaul610/article/details/117294103

________________________________________________________________________________________________________________

 

postman测试传入List<String>参数方式

 这篇文章主要介绍了postman测试传入List<String>参数方式,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教

 

 

postman测试传入List<String>参数

 

第一步:设置headers

postman测试传入List<String>参数方式

Content-type 的值为application/json

 

第二步:传值参数list<String>

在body中,传值参数,list<String> 使用[]括起来

postman测试传入List<String>参数方式

 

第三步:

controller层设置两个注解@ResponseBody 和@RequestBody

@ResponseBody 没有该注解的时候,会发生postman 请求找不到error 404;

@RequestBody 没有该注解的时候,会发生参数值传输不过去;

postman测试传入List<String>参数方式

 

使用postman传List参数 ,如果使用 Form Post方式必须在后台添加  @RequestParam

 1、后台部分

postman测试传入List<String>参数方式

 

2、postman部分

如果不适用注解的话,可能会抛出

No primary or default constructor found for interface java.util.List

postman测试传入List<String>参数方式

以上为个人经验,希望能给大家一个参考,也希望大家多多支持服务器之家。

原文链接:https://blog.csdn.net/qq_31123505/article/details/90475241

posted @ 2022-09-30 15:02  kelelipeng  阅读(6638)  评论(0编辑  收藏  举报