Results 1 to 3 of 3

Thread: [SOLVED] RESTful DELETE request without entity body

  1. #1
    Sencha User
    Join Date
    Jun 2010
    Location
    Brazil
    Posts
    10

    Default [SOLVED] RESTful DELETE request without entity body

    Using a RESTful store, how can I prevent the DELETE method from sending an entity body? Currently Ext is sending the record id in JSON format, but this is both redundant (because the resource ID is specified in the URL) and problematic (because this is not the canonical form of a RESTful DELETE request, and at least the Google App Engine web server won't allow requests in this format).

    I'm using by reference the sample application:

    http://www.sencha.com/deploy/dev/exa...l/restful.html

    This is how the store is defined:

    Code:
    var store = new Ext.data.Store({
        id: 'user',
        restful: true,     // <-- This Store is RESTful
        proxy: proxy,
        reader: reader,
        writer: writer
    });
    After pressing the "Delete" button, this is the request Ext JS sends:

    Code:
    DELETE http://www.sencha.com/deploy/dev/examples/restful/app.php/users/6 HTTP/1.1
    Host: www.sencha.com
    User-Agent: Mozilla/5.0 etc.
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 115
    Connection: keep-alive
    Content-Type: application/json; charset=UTF-8
    X-Requested-With: XMLHttpRequest
    Referer: http://www.sencha.com/deploy/dev/examples/restful/restful.html
    Content-Length: 10
    Cookie: bb_; etc.
    
    {"data":6}
    Notice the Content-Length header and the {"data":6} body.

    When a request in this format (with the "data" content) is submitted to Google App Engine, it replies with:

    Code:
    400 Bad Request
    So my question is, how can I prevent this entity body from being sent in DELETE requests, while still using a RESTful store?

  2. #2
    Sencha User
    Join Date
    Jun 2010
    Location
    Brazil
    Posts
    10

    Default

    Can anyone shed some light on how to make the behavior of RESTful delete on Ext JS more conformant?

  3. #3
    Sencha User
    Join Date
    Jun 2010
    Location
    Brazil
    Posts
    10

    Default

    Solved by a user on StackOverflow.

Similar Threads

  1. Restful DELETE IE
    By j.joslet in forum Ext 3.x: Help & Discussion
    Replies: 8
    Last Post: 2 Feb 2011, 11:00 AM
  2. Replies: 1
    Last Post: 8 Mar 2010, 7:52 AM
  3. Request entity too large - cookie problem
    By bhasheer in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 4 Nov 2009, 12:02 PM
  4. Replies: 50
    Last Post: 30 Apr 2008, 9:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •