sayonatinnofied / rest-client

Automatically exported from code.google.com/p/rest-client
Apache License 2.0
0 stars 0 forks source link

DELETE should support body entity #147

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Select Method DELETE
2. Click on the Body Tab
3. Observe that the buttons are greyed out

What is the expected output? What do you see instead?

I would expect to see the same behavior on the body tag as when POST or PUT are 
the selected methods.

What version of the product are you using? On what operating system?

2.4 JAR

Please provide any additional information below.

The HTTP spec seems to permit DELETE requests containing entity bodies. See 
this stackover flow thread:

http://stackoverflow.com/questions/299628/is-an-entity-body-allowed-for-an-http-
delete-request

This feature would be very helpful since many REST APIs include support for 
DELETE requests containing entity bodies.

Original issue reported on code.google.com by n...@noahwhite.net on 24 Jul 2012 at 3:48

GoogleCodeExporter commented 8 years ago
Thanks for reporting, I will look into it.

Original comment by subwiz on 24 Jul 2012 at 4:03

GoogleCodeExporter commented 8 years ago
The library we are using internally, Apache HTTP Client does not yet support 
entity body for delete:

http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http
/client/methods/HttpDelete.html

We will not be able to support DELETE with entity body until the library 
supports it.

Original comment by subwiz on 24 Jul 2012 at 4:32

GoogleCodeExporter commented 8 years ago
Thanks for looking into this. It would be a nice feature, hopefully Apache HTTP 
client will support this.

Original comment by n...@noahwhite.net on 25 Jul 2012 at 1:09

GoogleCodeExporter commented 8 years ago
Quoting from the mail from Oleg (owner of Apache HTTP Client project):

I personally think entity enclosing DELETE requests make no sense, but
this is all it takes to force HttpClient to support them
---
class EntityEnclosingDelete extends HttpEntityEnclosingRequestBase {

    @Override
    public String getMethod() {
        return "DELETE";
    }

}
---
Hope this helps

Oleg

Original comment by subwiz on 25 Jul 2012 at 3:50

GoogleCodeExporter commented 8 years ago
r635 and r636 has the fix.

Original comment by subwiz on 25 Jul 2012 at 11:56

GoogleCodeExporter commented 8 years ago
Development builds available here for testing:

http://dl.dropbox.com/u/2505020/restclient-ui-2.6-SNAPSHOT-app.zip

http://dl.dropbox.com/u/2505020/restclient-ui-2.6-SNAPSHOT-jar-with-dependencies
.jar

Original comment by subwiz on 26 Jul 2012 at 12:40

GoogleCodeExporter commented 8 years ago
Thanks. I downloaded it and will try it out.

Original comment by n...@noahwhite.net on 26 Jul 2012 at 2:27