gpt4 book ai didi

java - 通过 Amazon API Gateway 传递关联数组?

转载 作者:行者123 更新时间:2023-11-30 00:53:50 26 4
gpt4 key购买 nike

我正在为我的 api 资源使用 API 网关。我希望客户端将查询字符串中的过滤器作为关联数组传递,例如:

/photos?filter[from]=20-10-2015%2010:10:00&filter[to]=20-10-2015%2010:10:00

注意:它的 PHP 所以在我的后端我可以将它作为关联数组获取。我尝试通过添加过滤器作为查询参数,例如

enter image description here

使用 Android Api 网关客户端传递 filter 作为 "['from':'20-10-2016 10:10:00','to':'20-10- 2016 10:10:00']” 及其获取 Unparseable date: "20-10-2016 10:10:00"(at offset 10) 错误。


注意:尝试调试该问题并发现它是因为响应中返回了日期。在 Java SDK 上,它期望采用日期格式。作为回应,我返回 2015-10-11 12:11:30

我回来了

{
"schedule_date": "2015-10-20",
"completion_date": "2015-10-20",
}

响应的可能格式应该是什么?

最佳答案

API Gateway 目前不支持查询字符串参数中的 []。您需要将它们添加为 2 个不同的参数。

关于java - 通过 Amazon API Gateway 传递关联数组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40501098/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com