【发布时间】:2019-04-07 21:34:04
【问题描述】:
我在 AWS Api Gateway 中有一个带有 PUT 方法的 API。我在请求正文中传递了一个内容类型为 application/json
的对象{
"uuid": "i_1",
"insiderName": "Sam Keys",
"profileImage": "https://do6gbw1x8hs3.cloudfront.net/spree/cover_images/53977/default/400.jpg",
"gender": "Female",
"fullDescription": "This is the full description",
"shortDescription": "This is the short description",
"tribes": ["Adventurer"]
}
我正在传递一个名为tribes 的key 和一个作为数组的值。但我收到了这个错误:
{"message": "Could not parse request body into json: Unexpected character (\'A\' (code 65)): was expecting comma to separate Object entries\n at [Source: [B@5d62dfa1; line: 8, column: 17]"}
我认为错误是由请求正文中的数组引起的
【问题讨论】:
-
我不知道代码有什么问题,但是为了解决错误,您是否尝试过将数组放入带有键的对象中?
标签: json rest api-gateway