-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Parse.Cloud.httpRequest: provide default string encoding for body
option
#727
Comments
Originally the Parse.Cloud.httpRequest requires you to set the contentType manually so the body is properly encoded, either in JSON or in We could add the Would that help? |
Oh, I didn't realize that was the default behavior. I encountered this issue while trying to use the code here: https://github.com/ParsePlatform/JavaScriptModulesTutorial/blob/master/myMailModule-1.0.0.js I assumed that this was how Mailgun on Parse is implemented, but I guess that is not the case. I think parse-server should match hosted Parse as closely as possible, so I'm going to close this issue. |
then it's maybe not the default behaviour! how is it working on parse.com? |
I'm having a similar problem with this (used to work on Parse.com):
Parse.Cloud.httpRequest(requestOptions) is line 196. The command line:
|
@yuzeh how did you solve it? I still cannot get the https://github.com/ParsePlatform/JavaScriptModulesTutorial/blob/master/myMailModule-1.0.0.js return Parse.Cloud.httpRequest({
Checking the console.log shows that it does run, but the http status code returned by mailgun is always status 400. Which means the httpRequest is working but sending malformed requests to it. This same code used to work (without the added code of changing the param object into a string) on Parse. Any hints would be great. |
As a follow up, changing the Content-Type to multipart/form-data gives a different response from mailgun. Instead of 400, it now returns http status code of 502 |
I was using an API called OpenTok, and I basically got rid of it and made sure I was using the newest version of the SDK for it, and the newest build for Parse-Server. The code I had been using, was from a sample project that implemented the OpenTok API via parse server. By using npm install of the OpenTok framework from scratch, it seemed to be able to run it from scratch. Good luck.
|
Somewhat related to #703.
The 'request' library in node requires the
body
option to be a string, whereasParse.Cloud.httpRequest
will pass in an object if it is given an object, with noContent-Type
header.This is running on parse-server v2.1.3.
example node repl session illustrating the issue:
The text was updated successfully, but these errors were encountered: