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 · 6 comments
Closed

HttpMethods: add PATCH #167

wonderfly opened this issue Jan 9, 2015 · 6 comments

Comments

@wonderfly
Copy link
Contributor

@wonderfly wonderfly commented Jan 9, 2015

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

This comment has been minimized.

Copy link
Contributor Author

@wonderfly wonderfly commented Jan 9, 2015

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

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

@wonderfly

This comment has been minimized.

Copy link
Contributor Author

@wonderfly wonderfly commented Jan 9, 2015

@wonderfly

This comment has been minimized.

Copy link
Contributor Author

@wonderfly wonderfly commented Jan 9, 2015

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

Status: Fixed

@wonderfly wonderfly closed this Jan 9, 2015
@qubic

This comment has been minimized.

Copy link

@qubic qubic 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

This comment has been minimized.

Copy link

@shobhank shobhank commented Nov 29, 2018

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

This comment has been minimized.

Copy link

@clementepereyra clementepereyra commented Jan 8, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.