软件编程
位置:首页>> 软件编程>> java编程>> postman测试传入List<String>参数方式

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

作者:烟萝  发布时间:2022-10-13 01:34:40 

标签: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参数

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

0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com