View Full Version : POST or PUT JSON with store.save()

29 Apr 2011, 4:46 AM

Is it possible to somehow normally configure the store to send JSON with PUT and POST?

Currently it sends urlencoded JSON(data=someencodedjsonhere). This is not beautiful, restful and doesnt make any sense.

Any help would be appreciated!


29 Apr 2011, 6:40 AM
Visit the API docs for Ext.data.JsonStore (http://dev.sencha.com/deploy/ext-3.3.1/docs/?class=Ext.data.JsonStore) and look at the restful attribute.

29 Apr 2011, 8:54 AM
I have already this property set to true. But this Store is still not fully restful, it sends data back wrapped to some variable and urlencoded :((

29 Apr 2011, 9:21 AM
To get this working, I added "encode: false" parameter to my json writer. Also I followed guidelines from here:

Nasty hack but I cannot figure out any better solution also.

My REST service is not able to handle these uncommon wrapper variables that ext offers..

Configuring Ext to work with Jersey and other standard REST libs is a challenge...

29 Apr 2011, 9:24 AM
Take a look at the Ext.data.JsonWriter (http://dev.sencha.com/deploy/ext-3.3.1/docs/?class=Ext.data.JsonWriter) API docs and visit the encode config attribute.

29 Apr 2011, 12:38 PM
To change the method of transmission you can configure such on the Proxy. Look at the example under the 'api' config option.