+1
Answered

PUT to Parse.com?

sstava 7 years ago updated by icahill (Administrator) 7 years ago 8
Another parse.com question! I have been rolling along pretty well with retrieving data with parse.com (thanks John!)

My new questions is about updating an existing item in parse.com. The REST API specifies a PUT operation. From what I can tell, the Rarewire datasource tag allows POST and GET.

I tried PUT as an httpmethod, but didn't get a successful result.

I also tried curl from my terminal. I did a curl request with PUT to parse.com and it updated the item successfully. I did a POST with curl (all other info stayed the same) and it failed with a 404 error.

Can you point me in the right direction to do a PUT to Parse.com?

Thanks!
Steve
Steve,

PUT is currently not supported on our httpheader. We have this on our roadmap and it will be available soon.

You should be able to use POST in the meantime to accomplish what you need.
Thanks for the response. POST does not seem to be an option with a Parse.com REST update call.

I will see if I can get a javascript option to work with PUT. The Parse.com REST API fails on an update to an existing object when a POST is used.

They appear to look for the PUT verb for any updates to existing objects.

I tried using POST with Parse.com for an update REST call using curl (they explicitly call for PUT) and it failed. I tried PUT with the same test and same data and it worked with Parse.com

If you have any additional thoughts, they are welcome.

Thanks!
What specific scenario are you trying to accomplish? Does it make sense to delete and re-add the object using GET/POST?
I have a record in parse that is associated with a specific user. The record contains content that the user's company will choose to use or not use.

That specific user, when they open the app, will be presented the content and will be asked to approve or reject it.

My original approach was to mark that record as approved or rejected based on the users selection.

I think what I'm going to do at this point is jump ahead in my roadmap a little bit and separate the approval from the content. I will use the object ID of the original content record to link to a separate record that shows approval or rejection of that content.

Thanks for working with me on this! I appreciate the input and the different perspectives on how to look at solving the problem.

I may have to stop by at some point, since I'm only a couple blocks from you, and let you see the app you're helping me with :-)
I will keep you updated on the status of PUT as well. That would solve things.
That would be great. Thanks!
A quick update on doing PUT to Parse.com! Eventhough I can't use the PUT verb in the httpmethod, Parse.com has a "batch" option that allows you to send multiple creates/updates/deletes in one Parse request.

The beauty is that the request is a POST and it allows you to specify in the payload if you are doing a PUT/DELETE/POST.

With that being said, I can update an existing record (or many) with the "batch" call (still a real-time REST call) using httpmethod of POST :)

Yay!
Steve

P.S. I am still interested in when the PUT becomes available :)
Perfect Steve, forgive me for not suggesting that. I am still navigating the Parse integration possibilites.