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

HttpMethods: add PATCH #167

Closed
wonderfly opened this issue Jan 9, 2015 · 7 comments
Closed

HttpMethods: add PATCH #167

wonderfly opened this issue Jan 9, 2015 · 7 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@wonderfly
Copy link
Contributor

From yan...@google.com on November 19, 2012 13:22:24

External references, such as a standards document, or specification? http://tools.ietf.org/html/rfc5789 Java environments (e.g. Java 6, Android 2.3, App Engine, or All)? All Please describe the feature requested. Google APIs make use of the HTTP PATCH verb, and there is an actual standard document behind it, so might as well add it to HttpMethods.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=167

@wonderfly wonderfly added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. imported priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jan 9, 2015
@wonderfly wonderfly self-assigned this Jan 9, 2015
@wonderfly
Copy link
Contributor Author

From yan...@google.com on December 13, 2012 06:38:11

Labels: -Milestone-Version1.13.0 Milestone-Version1.14.0

@wonderfly
Copy link
Contributor Author

From yan...@google.com on December 27, 2012 09:50:48

https://codereview.appspot.com/7016047/

Status: Started
Owner: yan...@google.com
Cc: ngmic...@google.com rmis...@google.com

@wonderfly
Copy link
Contributor Author

From yan...@google.com on December 27, 2012 10:40:37

Status: Fixed

@qubicllj
Copy link

qubicllj commented Sep 18, 2018

The patch method is unsupported again.

httpRequest = requestFactory.buildPatchRequest(new GenericUrl(url), jsonHttpContent); httpResponse = httpRequest.execute();

The code above throw an exception:

java.lang.IllegalArgumentException: HTTP method PATCH not supported at com.google.api.client.repackaged.com.google.common.base.Preconditions.checkArgument(Preconditions.java:148) at com.google.api.client.util.Preconditions.checkArgument(Preconditions.java:69) at com.google.api.client.http.javanet.NetHttpTransport.buildRequest(NetHttpTransport.java:133) at com.google.api.client.http.javanet.NetHttpTransport.buildRequest(NetHttpTransport.java:62) at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:872)

I checked the code of NetHttpTransport.java
The variable "SUPPORTED_METHODS" missing patch method.

@shobhank
Copy link

This issue is still happening. Can you please point me to version that has PATCH support?

I still get error for PATCH
HTTP method PATCH not supported
at com.google.api.client.repackaged.com.google.common.base.Preconditions.checkArgument(Preconditions.java:148)
at com.google.api.client.util.Preconditions.checkArgument(Preconditions.java:69)
at com.google.api.client.http.javanet.NetHttpTransport.buildRequest(NetHttpTransport.java:133)
at com.google.api.client.http.javanet.NetHttpTransport.buildRequest(NetHttpTransport.java:62)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:872)

@clementepereyra
Copy link

In case anyone still looking to solve this issue, there's a new way to do it.
Instead of using com.google.api.client.http.javanet.NetHttpTransport use com.google.api.client.http.apache.v2.ApacheHttpTransport

You'll need to add the following dependency:
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-apache-v2</artifactId>
<version>1.34.0</version>
</dependency>

Where 1.34.0 is the current latest version, though it would probably work with lower versions.

@patrickofriel-wk
Copy link

Is it possible to get Patch support in NetHttpTransport? ApacheHttpTransport has a bunch of extra "stuff" around connection pooling that we'd rather not deal with if possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

5 participants