New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DELETE with Body in Retrofit 1.5.0 #458
Comments
Can you paste the full stack trace? I suspect the HTTP client you are using is being overly strict. |
Yep sorry, I forgot posting the full stack strace. Trace (cause & detailMessage from Retrofit) using custom annotation:
Trace using DELETE:
For having more info, heere is my service call:
where CustomClient is:
|
@JakeWharton Are you planning support this in future versions? Thank you mate! |
This is a limitation by the HTTP client, not Retrofit. OkHttp version 2.0 will fix this and I'm not sure as to whether the Apache client supports this or not. We won't be able to make this work for HttpUrlConnection. |
Thx! On 22 May 2014 23:34, "Jake Wharton" notifications@github.com wrote:
|
Hi, I don't get it. I'm using RetroFit 1.6.0 and okhttp 2.0.0-RC2 and I'm still having the error: Yet the issue #605: "Allow DELETE Request Body, Ensure Sane Behavior" is marked as fixed on the okhttp git repository. Am I missing something ? Thanks |
Retrofit's |
Which I did and it works fine. |
Which HTTP spec says there shouldn't be one? |
There is nothing in the specs that strictly prevent us from implementing DELETE with body. Retrofit should be flexible too. |
The response is on the HTTP 1.1 RFC (http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.7) A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not include an entity. The DELETE method could return a message but isn't mandatory |
This worked for me, just use it like a normal DELETE except it actually works with a body! |
I'm using
But cannot find symbol |
With Retrofit 2 the solution is to use the HTTP interface instead of DELETE.
By
I would like to create my own interface DELETE_BODY but I didn't find how yet since like you said RestMethod is not available anymore. |
Hi,
First of all, I know that including body in DELETE request is bad, but I'm working for a customer with a legacy API, so I can't avoid it.
I'm getting this error (and the app stops):
I've been having look to other responses:
#330
#426
But neither of them worked for me with Retrofit 1.4.1
If I use my custom DELETE annotation:
I get the next error (and the app doesn't stop):
Is there any kind of dirty solution for now?
Thanks in advance!
The text was updated successfully, but these errors were encountered: