Ext


Go Back   Ext JS Forums > Ext JS Community Forums (3.0) > Ext: Help

Reply
 
Thread Tools
  #1  
Old 11-07-2009, 04:10 AM
frif frif is offline
Ext User
 
Join Date: Sep 2009
Posts: 13
frif is on a distinguished road
Question setting content-type=application/json in JSONWriter DELETE?

Hello,

Question: How can force the content type to be application/json for the DELETE requests sent by JSONStore?

I've been looking at the examples at extjs own web site, like

http://www.extjs.com/deploy/dev/exam...l/restful.html
http://www.extjs.com/deploy/dev/exam...er/writer.html

The DELETEs sent to the server by JSONWriter have content-type application/x-www-form-urlencoded, instead of application/json

POST and PUT however have content-type=application/json

I understand that the DELETE packets don't contain any data, so it seems there is no need to put the content-type=application/json. However my server[*] automatically serializes the response according to the content-type of the request, therefore I need to have the right content-type for the DELETE requests as well.

Thanks
frif
[*] I'm using the Catalyst Framework (perl 5)
Reply With Quote
  #2  
Old 11-07-2009, 05:14 AM
frif frif is offline
Ext User
 
Join Date: Sep 2009
Posts: 13
frif is on a distinguished road
Default

Solved. I found the answer in this thread:

http://www.extjs.com/forum/showthrea...t=72362&page=2

I just needed to set the headers in the HttpProxy of the store that uses the JsonWriter. It's configuration object is like this:

{
       url: '/rest/users',
       // Ask for Json response
       headers: { 'Content-Type': 'application/json;charset=utf-8' }
}
Reply With Quote
Reply

Thread Tools

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -5. The time now is 10:16 AM.

© 2006-2009 Ext, LLC
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.