-
-
Notifications
You must be signed in to change notification settings - Fork 597
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
RESTController - Allow for GET requests #630
Comments
I can't answer for everything but for etags, this was enabled there so you may want to ask the original author directly.
Besides etag I don't believe the server provides any cache headers.
The REST API is the main API used by the SDK, the fact that you can bundle your requests as a POST request is an implementation detail. If you build a native SDK, you should use the REST API. I would be enclined to let the JS SDK have an optional ALSO, this can be implemented in a separate REST controller outside the SDK for now. So you can test it, improve it and understand the limits. Switching the RESTController is easy:
|
True, just checked again, my bad
Thanks a lot for the tip! That'll work for me for now! I've been testing these GET requests today and it seems to work perfectly, even with complex queries. Another interesting thing to note is that the Parse Dashboard's API Console itself sends proper GET/PUT/POST/DELETE requests from the web browser, and doesn't implement its requests with I'm staying on the loop to make a PR if it's ever considered for being implemented, depending on the original authors' feedback. |
One good reason I could think of is IE9 compatibility / cross domain requests at the time. Maybe sending headers was tricky with IE9, as the following code suggests: |
Ideally I'd love to abstract away all the request making of this SDK, and probably remove the IE9 support etc... when possible :) |
It's unrelated to IE9, but it is related to CORS. |
That would make total sense! Thanks @andrewimm. |
Also since the "headers" arg came up, I'm pretty sure the only time we do pass custom headers is related to uploading files. That one endpoint needed to support some extra behavior and go around the typical networking path. |
Thanks a lot for your feedback, this makes a lot of sense. @andrewimm You're right, it is: https://github.com/parse-community/Parse-SDK-JS/blob/master/src/ParseFile.js#L244 |
That was the entire goal of CoreManager in the first place – allowing pluggable implementations. We used a custom REST implementation in the hosted version of Cloud Code, too. Glad the architecture is still valuable. |
@andrewimm this is through a custom rest controller that the server provides a 'direct access' controller. |
@ridem do you mind if we close this one then? |
I agree, let's close this issue! |
Always a pleasure! |
This post is very useful! Thanks |
Note: As originally proposed at #629
Motivations:
ETag
s are served by parse-server, it surely was to be used in the web browser - the fact that the official JS SDK doesn't support it on its end is suprisingDrawbacks:
If this was made to fix some concerns with the requests sent from a web browser (compatibility, security), I'm wondering why having bothered with parse-server sending browser-caching compliant headers.
If it's because it's just the way the requests should be sent to a parse-server, then I don't understand why the REST Guide suggests otherwise.
The text was updated successfully, but these errors were encountered: