Skip to content
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

Is their patch support #53

Closed
braghome opened this issue Sep 16, 2013 · 2 comments
Closed

Is their patch support #53

braghome opened this issue Sep 16, 2013 · 2 comments

Comments

@braghome
Copy link

I get errors when using it like this
/v1/users/ java.net.ProtocolException: Invalid HTTP method: PATCH

@kevinsawicki
Copy link
Owner

Hi, sorry for the delay in response, I don' t think the underlying HttpUrlConnection class supports PATCH so I don't think it is possible.

Usually most APIs support another request method in lieu of patch. For example the GitHub API supports using POST requests instead of PATCH.

@SleeplessByte
Copy link

Hi @kevinsawicki, @braghome

HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setRequestMethod("PATCH");

Unfortunately it will only accept for
"OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE"

Someone should try to override it. See what happens, Like in square/okhttp#498, but removed in square/retrofit#425

More discussion on https://www.mail-archive.com/[email protected]/msg02078.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants