好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

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

 

postman测试传入List<String>参数

 

第一步:设置headers

Content-type 的值为application/json

 

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

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

 

第三步:

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

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

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

 

使用postman传List参数

 

1、后台部分

 

2、postman部分

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

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

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

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

查看更多关于postman测试传入List<String>参数方式的详细内容...

  阅读:88次