-
-
Notifications
You must be signed in to change notification settings - Fork 735
Invalid key name error. #383
New issue
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
Comments
I am too facing this problem. When i intercepted the network calls, i found the request body was carrying information as _method:GET, but the HTTP request was a POST. HTTP POST Request Body - JSON.
HTTP Response Error code: 400 Bad Request
Not sure where the fix should be. Server side code or Android client side SDK. |
I am also getting this error on my Android app. Looking for fixing 👍 |
In case anyone interested this PR changes solved this issue. parse-community/parse-server#105. I had this change on my parse-server - Classes.js. And the issue is gone. |
Thanks for stepping in @smanikandan14! I'll be closing this as resolved. FYI queries are sometimes sent as POST instead of GET as a workaround for URI length limits. |
@grantland @smanikandan14 How can implement this? In my parse-server I don't have a file called classes.js! I really need help to solve this problem! My Parse version is 2.2.7. |
After calling query.find() I am getting error 105 - Invalid key name.
This happens because the ParseRESTQueryCommand changes its method from GET to POST in the last moment before being sent to the server. As a result the restWhere object on the server is a String instead of Object and the server returns error 105.
The offending code is in ParseRESTCommand :
@OverRide
protected ParseHttpRequest newRequest(
ParseHttpRequest.Method method,
String url,
ProgressCallback uploadProgressCallback) {
ParseHttpRequest request;
if (jsonParameters != null &&
method != ParseHttpRequest.Method.POST &&
method != ParseHttpRequest.Method.PUT) {
// The request URI may be too long to include parameters in the URI.
// To avoid this problem we send the parameters in a POST request json-encoded body
// and add a http method override parameter in newBody.
request = super.newRequest(ParseHttpRequest.Method.POST, url, uploadProgressCallback);
} else {
request = super.newRequest(method, url, uploadProgressCallback);
}
ParseHttpRequest.Builder requestBuilder = new ParseHttpRequest.Builder(request);
addAdditionalHeaders(requestBuilder);
return requestBuilder.build();
}
After I comment out the change to POST everything works fine, however I can't figure out if the request being too long will hurt me at some point.
I am using your parse-server node module and your Android SDK as is, no changes on my part.
The text was updated successfully, but these errors were encountered: