简体   繁体   English

通过名单<string>在@RequestHeader Restapi</string>

[英]Passing List<String> in @RequestHeader Restapi

I want to pass list of string in my controller via Request Header @RequestHeader("list") final List<String> listOfString .我想通过请求 Header @RequestHeader("list") final List<String> listOfString在我的 controller 中传递字符串列表。 Can this be used.这个可以用吗。 How can I pass list of string in header via Postman ?如何通过Postman传递 header 中的字符串列表?

list={item1,item2,item3} . list={item1,item2,item3} This is not working while I want to test via Postman.当我想通过 Postman 进行测试时,这不起作用。 Is there any way?有什么办法吗?

You can add the header this way您可以通过这种方式添加 header

在此处输入图像描述

In the headers tab, just add it with comas.在标题选项卡中,只需添加逗号即可。

you can use JSON Array Like This: ["data1","data2"]您可以像这样使用 JSON 数组: ["data1","data2"]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM