-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Allow body in custom HTTP methods #3038
Conversation
I don’t think I understand the utility of the boolean parameter. Shouldn’t we just relax our rules and permit the custom method? |
Ideally, yes - that'd be more in line with the spec as I understand it, and that's how I've done it in a custom internal fork. My thinking was that the boolean parameter would keep the current behaviour and error handling exactly the same, just in case anyone relied on this current behaviour (unlikely but not possible). I'd be happy to update the PR to remove the |
Yeah, let's do that. |
b8059ee
to
5aa1a39
Compare
I updated the PR, I believe this is now better conforming to the HTTP spec. |
Any news on this? |
@@ -54,7 +54,6 @@ | |||
import okhttp3.internal.Version; | |||
import okhttp3.internal.http.HttpDate; | |||
import okhttp3.internal.http.HttpHeaders; | |||
import okhttp3.internal.http.HttpMethod; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind reverting the changes to OkHttpUrlConnection? This is likely to be backwards-incompatible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(particularly the part where it looks like we now always send a content-type, even on GET requests)
public static boolean redirectsWithBody(String method) { | ||
return method.equals("PROPFIND"); // (WebDAV) redirects should also maintain the request body | ||
} | ||
|
||
public static boolean redirectsToGet(String method) { | ||
// All requests but PROPFIND should redirect to a GET request. | ||
return !method.equals("PROPFIND"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this?
I’m getting ready to cut OkHttp 3.6. Wanna revert your unnecessary changes? |
Please integrate this fix because I really need to use PROPFIND with OkHttp. |
Any plan for this pull request? I need it. |
I think #3777 covers this |
This should fix the issues expressed here: #229