Ember Data 1.0 - HTTP Post request


#1

Hello,

Can I send a Post request by Ember Data 1.0 Beta? I have tried to it, with the new TRANISITION.md instructions, but without any success. The createRecord is always making me a GET request.

In addition, can I combine a POST request with a query string?

I’m afraid that Ember Data is still lacking those things, and I have doubts whether to do it by a “Simple” Ember.$.ajax, or by Ember-Model, which I think will not be a good choice in the long run.

Thank you so much for your effort. I have seen ember and it is the best thing I came across. , but this tiny thing really is killing me for over a month.


#2

Using Ember.$.ajax is fine, if ED doesn’t cover your case.


#3

Thank you abuiles! Does it mean that I won’t be able to use DS.store and to define relationships with Ember Data as ORM? Or is there a trick to combine it?


#4

@Sword Ember Data, does posts when it needs to do a post, I need you don’t have to worry about it.

I thought you were asking if there was a direct way to do a post without using ED.

What’s your scenario?


#5

OK @abuiles, I’m into the stable solution and I want to build it right.

With every operation of the user (when he updates, presses like, or adds a comment), I want the information to be sent to my RESTful server.

The tricky part is that I have to send a very long encrypted string for authentication in the server side (=facebook signedRequest, my server will first decode the string). That’s why I prefer it to be with a HTTP Post request.

With the same post request, I want other information to be sent for manipulation in the server, after the user has been authenticated. The first scenario is registration, but this kind of sending info&signedRequest will be implemented for most of my users’ operations in the site.

P.S: I don’t think I would have any GET operations (except of public information), because I need all of the users to be authenticated first and later to get info like their messages and stuff.

I appreciate your kindness alot, Dor.


#6

I have continued to search, and found an article about [Ember without Ember Data][1]. Is it true that ED is an obstacle? I’ve also heard about things like Emu, epf and Ember-Model.

I don’t know what to do. I don’t want to reinvent the wheel by choosing to use a simple Ajax. I want the powerful of ED about the relationships and storing logic.

Isn’t that weird that we can’t use ember for sending long strings which requires HTTP POST? There is the RESTAdapter and the idea behind this STATEless server logic is to actually get authentication for every user request. What am I missing here?

Could you give me the use cases of Ember’s decision?

Thanks… [1]: http://eviltrout.com/2013/03/23/ember-without-data.html