Adding PATCH header override the default Java client

This commit is contained in:
Andrew B
2016-02-12 18:52:49 -08:00
parent 9bea6943a2
commit a303a09749
17 changed files with 169 additions and 43 deletions

View File

@@ -517,7 +517,10 @@ public class ApiClient {
response = builder.type(contentType).put(ClientResponse.class, serialize(body, contentType, formParams));
} else if ("DELETE".equals(method)) {
response = builder.type(contentType).delete(ClientResponse.class, serialize(body, contentType, formParams));
} else {
} else if ("PATCH".equals(method)) {
response = builder.type(contentType).header("X-HTTP-Method-Override", "PATCH").post(ClientResponse.class, serialize(body, contentType, formParams));
}
else {
throw new ApiException(500, "unknown method type " + method);
}
return response;