|
|||||||
![]() |
|
|
Thread Tools |
|
#1
|
|||
|
|||
|
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) |
|
#2
|
|||
|
|||
|
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' }
}
|
![]() |
| Thread Tools | |
|
|