Closed GoogleCodeExporter closed 9 years ago
Add HTTP DELETE support.
Original comment by tinyeeliu@gmail.com
on 21 Aug 2012 at 2:50
very interested in PUT support
Original comment by irapha...@gmail.com
on 24 Aug 2012 at 1:54
Can you provide some use cases of put?
I would like to support PUT but there are couple options.
1. Take an HttpEntity
2. Take a String of content type and byte[]
3. Take various object types and set the proper content type header
Original comment by peter....@aigens.com
on 24 Aug 2012 at 5:12
Hi Peter. Many thanks for DELETE support.
In the first view for PUT method we can use the same scheme as for POST and
allow developers check for server messages (like 501 error etc.).
For content type headers and objects we can use available methods as well as
for POST. For example developer can apply necessary content-type header for
request and POST/PUT object like:
AjaxCallback<JSONObject> cb = new AjaxCallback<JSONObject>();
cb.header("Content-Type", "application/json");
StringEntity se = new StringEntity(postJson.toString()); // If we want to send
json object for example
se.setContentType(new BasicHeader(HTTP.CONTENT_TYPE,
"application/json"));
Map<String, Object> params = new HashMap<String, Object>();
params.put(AQuery.POST_ENTITY, se);
cb.params(params);
I hope this help :).
Original comment by yaroslav...@gmail.com
on 24 Aug 2012 at 6:17
Put is now supported in latest beta. Keep in mind this method is not widely
tested as there's not much popular services that support put. Please share your
input on how to make put easy for your use case.
Example:
StringEntity entity = new StringEntity(new JSONObject().toString());
aq.put(url, "application/json", entity, JSONObject.class, cb);
Original comment by tinyeeliu@gmail.com
on 29 Aug 2012 at 6:40
Many thanks, PUT works fine.
Original comment by yaroslav...@gmail.com
on 5 Sep 2012 at 6:12
Mark fixed for now until user request more PUT usage patterns.
Original comment by tinyeeliu@gmail.com
on 6 Sep 2012 at 9:42
Hi Peter.
I work on a new project and client web-service require http DELETE with request
body like POST or PUT requests. As I see android-query supports DELETE requests
without body only. Can you add support for DELETE requests with body?
P.S. I investigated this issue and found a good solution for this, see
http://stackoverflow.com/questions/3773338/httpdelete-with-body/3820549#3820549
Original comment by yaroslav...@gmail.com
on 5 Oct 2012 at 7:24
So that API only usable from Android?
Just curious how other platform like web (javascript) and on iOS would
do that easily.
It does seem out of the norm and http client's HttpDelete doesn't even
let you set the entity body.
You sure that's the only way to call that API?
If so probably need to implement that workaround but I doubt it's
going to be useful to general public.
Original comment by tinyeeliu@gmail.com
on 5 Oct 2012 at 8:10
As I understand DELETE request shouldn't use body but can, because this doesn't
clearly forbidden in the protocol description.
HttpDelete extends HttpRequestBase but HttpPost extends
HttpEntityEnclosingRequestBase which has setEntity method. Proposed solution
only extends HttpDelete from HttpEntityEnclosingRequestBase instead of
HttpRequestBase. So we can use setEntity for request body.
Some web services require body for this request so I think this functionality
will be usefull for many people.
Original comment by yaroslav...@gmail.com
on 5 Oct 2012 at 12:33
Original comment by tinyeeliu@gmail.com
on 5 Oct 2012 at 1:58
Reopened this to check if body with delete can be supported.
Original comment by tinyeeliu@gmail.com
on 5 Oct 2012 at 1:59
Hi Peter! Any news about support delete request with body?
Original comment by yaroslav...@gmail.com
on 23 Oct 2012 at 10:43
Due to lack of way to test DELETE with body, I will close this unless there's
further demand.
If you can point out a popular public API that accept DELETE with batch, I will
reopen it.
Original comment by tinyeeliu@gmail.com
on 14 Dec 2012 at 10:16
PUT is used by couchdb so you know how important it is... it enables a keyed
document to be created vs. the db deciding on a location for it.
Original comment by humanli...@gmail.com
on 28 Feb 2013 at 11:56
PUT and DELETE is already supported.
Original comment by peter....@aigens.com
on 28 Feb 2013 at 11:59
Yes I am using both and works great.
Original comment by humanli...@gmail.com
on 28 Feb 2013 at 9:34
Original issue reported on code.google.com by
peter....@aigens.com
on 21 Jun 2012 at 8:20