forked from loafle/openapi-generator-original
[Java] Jersey, Jersey2 and Resteasy clients do not support HTTP-HEAD (#6210)
This commit is contained in:
parent
fab49e80a8
commit
be9a9a3837
@ -667,8 +667,9 @@ public class ApiClient {
|
|||||||
response = builder.type(contentType).delete(ClientResponse.class, serialize(body, contentType, formParams));
|
response = builder.type(contentType).delete(ClientResponse.class, serialize(body, contentType, formParams));
|
||||||
} else if ("PATCH".equals(method)) {
|
} else if ("PATCH".equals(method)) {
|
||||||
response = builder.type(contentType).header("X-HTTP-Method-Override", "PATCH").post(ClientResponse.class, serialize(body, contentType, formParams));
|
response = builder.type(contentType).header("X-HTTP-Method-Override", "PATCH").post(ClientResponse.class, serialize(body, contentType, formParams));
|
||||||
}
|
} else if ("HEAD".equals(method)) {
|
||||||
else {
|
response = builder.head();
|
||||||
|
} else {
|
||||||
throw new ApiException(500, "unknown method type " + method);
|
throw new ApiException(500, "unknown method type " + method);
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
|
@ -636,7 +636,7 @@ public class ApiClient {
|
|||||||
*
|
*
|
||||||
* @param <T> Type
|
* @param <T> Type
|
||||||
* @param path The sub-path of the HTTP URL
|
* @param path The sub-path of the HTTP URL
|
||||||
* @param method The request method, one of "GET", "POST", "PUT", and "DELETE"
|
* @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE"
|
||||||
* @param queryParams The query parameters
|
* @param queryParams The query parameters
|
||||||
* @param body The request body object
|
* @param body The request body object
|
||||||
* @param headerParams The header parameters
|
* @param headerParams The header parameters
|
||||||
@ -697,6 +697,8 @@ public class ApiClient {
|
|||||||
response = invocationBuilder.delete();
|
response = invocationBuilder.delete();
|
||||||
} else if ("PATCH".equals(method)) {
|
} else if ("PATCH".equals(method)) {
|
||||||
response = invocationBuilder.method("PATCH", entity);
|
response = invocationBuilder.method("PATCH", entity);
|
||||||
|
} else if ("HEAD".equals(method)) {
|
||||||
|
response = invocationBuilder.head();
|
||||||
} else {
|
} else {
|
||||||
throw new ApiException(500, "unknown method type " + method);
|
throw new ApiException(500, "unknown method type " + method);
|
||||||
}
|
}
|
||||||
|
@ -561,7 +561,7 @@ public class ApiClient {
|
|||||||
* Invoke API by sending HTTP request with the given options.
|
* Invoke API by sending HTTP request with the given options.
|
||||||
*
|
*
|
||||||
* @param path The sub-path of the HTTP URL
|
* @param path The sub-path of the HTTP URL
|
||||||
* @param method The request method, one of "GET", "POST", "PUT", and "DELETE"
|
* @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE"
|
||||||
* @param queryParams The query parameters
|
* @param queryParams The query parameters
|
||||||
* @param body The request body object
|
* @param body The request body object
|
||||||
* @param headerParams The header parameters
|
* @param headerParams The header parameters
|
||||||
@ -619,6 +619,8 @@ public class ApiClient {
|
|||||||
response = invocationBuilder.delete();
|
response = invocationBuilder.delete();
|
||||||
} else if ("PATCH".equals(method)) {
|
} else if ("PATCH".equals(method)) {
|
||||||
response = invocationBuilder.header("X-HTTP-Method-Override", "PATCH").post(entity);
|
response = invocationBuilder.header("X-HTTP-Method-Override", "PATCH").post(entity);
|
||||||
|
} else if ("HEAD".equals(method)) {
|
||||||
|
response = invocationBuilder.head();
|
||||||
} else {
|
} else {
|
||||||
throw new ApiException(500, "unknown method type " + method);
|
throw new ApiException(500, "unknown method type " + method);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user