HTTP method PATCH not supported

Open
#1,316 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
networking

Research direction

Start in the HttpRequest class at the transport.buildRequest(requestMethod, urlString) call, reproducing the PATCH request with google-http-client 1.38.1 and the Java 8 environment described. Trace how the transport handles request methods and verify that a PATCH request can be built without the reported IllegalArgumentException.

Written by the indexing model from the issue text.

Description

priority: p2 type: feature request
Environment details
  • OS:Linux
  • Java version:1.8
  • google-http-java-client version: 1.38.1
Steps to reproduce

Hello everyone,

I am trying to make an http patch call with the google-http-client-1.38.1 library, but it is returning an error. I have no problem making HTTP GET, POST, or PUT calls.

I have debugged the library files and I have seen that the error occurs in the httpRequest class when it is going to build the request
LowLevelHttpRequest lowLevelHttpRequest = transport.buildRequest (requestMethod, urlString)
I build the request with the following format
val req = httpRequestFactory .buildRequest( "PATCH", GenericUrl(URL), HTTP_CONTENT) .setThrowExceptionOnExecuteError(false) .setLoggingEnabled(true) .setHeaders(HTTP_HEADERES)

Stacktrace

java.lang.IllegalArgumentException: HTTP method PATCH not supported

External references such as API reference guides used

I am using the google-http-client-1.38.1 through google-auth-library-oauth2-http 0.24.0

Thanks!

Dominant language
Java
Stars
1.4k
Forks
476
Avg merge
10h 47m
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/google-http-java-client

All issues in googleapis/google-http-java-client

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.