简体   繁体   中英

Android AWS APIGateway Client Exception (Code 100)

I'm trying upload a base64 image that is converted to a string. When sending the string I am getting a ApiClientException. The base64 image looks something like this:

{"base64String":"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHB......"}

I create a JSONObject to store the base64 data then convert it to a string (which is the reason the data is encapsulated above).

com.amazonaws.mobileconnectors.apigateway.ApiClientException: {"message": "Could not parse request body into json: Unexpected character (\'d\' (code 100)): was expecting comma to separate Object entries\n at [Source: [B@31587f68; line: 2, column: 17]"} (Service: AllyantsAPIClient; Status Code: 400; Error Code: null; Request ID: 9f2f752d-fc9a-11e7-8d90-517849cc68d9)

Any help would be greatly appreciated!

The error is 400:

400 Bad Request Exception

Thats mean sends some invalid data in the request, incorrect content or parameters. The error is in your side.

我发现答案是错误的AWS APIGateway SDK,我重新部署了APIGateway并再次为Android生成了SDK,问题消失了。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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