如何使用http GET方法传递查询字符串中的数组值?
[http://localhost:3011/api/latest/os/archive/catalogue?Labels=[](http://localhost:3011/api/latest/os/archive/catalogue?Labels=[){Label:标签名称-1},{Label:标签名称-2}]&CatalogueID=101&ArchivePolicyID=122
如果传递这些值,如何使用键或索引值获取数组值。
发布于 2018-02-07 17:45:20
您可以使用数组赋值在url中创建数组,例如。在服务器上看起来像things = ["zero", "one"]
的things[]=zero&things[]=one
。
您还需要分配一个带有things[][label]=value
的关联数组,该数组将在服务器上作为things = [{label: "value"}]
拾取
http://localhost:3011/api/latest/os/archive/catalogue?Labels[][label]=Name%20of%20Label-1&Labels[][label]=Name%20of%20Label-2}]&CatalogueID=101&ArchivePolicyID=122
https://stackoverflow.com/questions/48660428
复制相似问题