8000 Add HTTP PATCH support · sdecima/google-http-java-client@7f68cf4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7f68cf4

Browse files
friedfilibusterejona86
authored andcommitted
Add HTTP PATCH support
1 parent 0c7f495 commit 7f68cf4

File tree

1 file changed

+4
-1
lines changed
  • google-http-client-appengine/src/main/java/com/google/api/client/extensions/appengine/http

1 file changed

+4
-1
lines changed

google-http-client-appengine/src/main/java/com/google/api/client/extensions/appengine/http/UrlFetchTransport.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ enum CertificateValidationBehavior {
6262
* order.
6363
*/
6464
private static final String[] SUPPORTED_METHODS =
65-
{HttpMethods.DELETE, HttpMethods.GET, HttpMethods.HEAD, HttpMethods.POST, HttpMethods.PUT};
65+
{HttpMethods.DELETE, HttpMethods.GET, HttpMethods.HEAD, HttpMethods.POST,
66+
HttpMethods.PUT, HttpMethods.PATCH};
6667
static {
6768
Arrays.sort(SUPPORTED_METHODS);
6869
}
@@ -119,6 +120,8 @@ protected UrlFetchRequest buildRequest(String method, String url) throws IOExcep
119120
httpMethod = HTTPMethod.HEAD;
120121
} else if (method.equals(HttpMethods.POST)) {
121122
httpMethod = HTTPMethod.POST;
123+
} else if (method.equals(HttpMethods.PATCH)) {
124+
httpMethod = HTTPMethod.PATCH;
122125
} else {
123126
httpMethod = HTTPMethod.PUT;
124127
}

0 commit comments

Comments
 (0)
0