We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I use this code to save a Record
HashMap<String ,Object> commentData = new HashMap<>(); commentData.put("title","haha comment"); commentData.put("data","world is bad"); Record aComment = new Record("Comment",commentData); skygear.getPublicDatabase().save(aComment, new RecordSaveResponseHandler() { @Override public void onSaveSuccess(Record[] records) { Log.i("MyApplication", "Record saved"); } @Override public void onPartiallySaveSuccess(Map<String, Record> successRecords, Map<String, Error> errors) { Log.i("MyApplication", "Some records are failed to save"); } @Override public void onSaveFail(Error error) { Log.w("MyApplication", "Failed to save: " + error.getMessage(), error); } });
The request body like this: { "database_id": "_public", "api_key": "123456789", "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyNjc1N2UyZC01Yzg3LTQ4YTQtYjY2Ni05MmY1YWRlMjQ1MjAiLCJpYXQiOjE0OTc1ODA5MzMsImlzcyI6ImVhc3lib29rIiwic3ViIjoiMWNjOGViYWQtZGYwMy00MjAxLThkMWQtMmQ1YmYzOWYwNDQ4In0.BuD5x13I5TLQcdUz5CRAzscaMyWgnx5BnifFNcrq0Yc", "action": "record:save", "records": [{ "data": "world is bad", "title": "haha comment", "_id": "Comment/84004521-76ca-402e-a050-1ffd13876f32", "_created_at": "2017-06-16T02:42:31.898Z", "_updated_at": "2017-06-16T02:42:31.898Z", "_access": [{ "level": "read", "public": true }] }] }
and get this error { "error": { "name": "BadRequest", "code": 107, "message": "fails to decode the request payload" } }
What cause this problem and how to fix it
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I use this code to save a Record
The request body like this:
{
"database_id": "_public",
"api_key": "123456789",
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyNjc1N2UyZC01Yzg3LTQ4YTQtYjY2Ni05MmY1YWRlMjQ1MjAiLCJpYXQiOjE0OTc1ODA5MzMsImlzcyI6ImVhc3lib29rIiwic3ViIjoiMWNjOGViYWQtZGYwMy00MjAxLThkMWQtMmQ1YmYzOWYwNDQ4In0.BuD5x13I5TLQcdUz5CRAzscaMyWgnx5BnifFNcrq0Yc",
"action": "record:save",
"records": [{
"data": "world is bad",
"title": "haha comment",
"_id": "Comment/84004521-76ca-402e-a050-1ffd13876f32",
"_created_at": "2017-06-16T02:42:31.898Z",
"_updated_at": "2017-06-16T02:42:31.898Z",
"_access": [{
"level": "read",
"public": true
}]
}]
}
and get this error
{
"error": {
"name": "BadRequest",
"code": 107,
"message": "fails to decode the request payload"
}
}
What cause this problem and how to fix it
The text was updated successfully, but these errors were encountered: