add missing doXXX methods with KeycloakSession usage

closes #30302

Signed-off-by: Niko Köbler <niko@n-k.de>
This commit is contained in:
Niko Köbler 2024-06-10 18:26:17 +02:00 committed by Alexander Schwartz
parent 51d80a42d5
commit 72f994dc1c

View file

@ -125,14 +125,29 @@ public class SimpleHttp {
return new SimpleHttp(url, "POST", client, maxConsumedResponseSize); return new SimpleHttp(url, "POST", client, maxConsumedResponseSize);
} }
public static SimpleHttp doPut(String url, KeycloakSession session) {
HttpClientProvider provider = session.getProvider(HttpClientProvider.class);
return doPut(url, provider.getHttpClient(), provider.getMaxConsumedResponseSize());
}
protected static SimpleHttp doPut(String url, HttpClient client, long maxConsumedResponseSize) { protected static SimpleHttp doPut(String url, HttpClient client, long maxConsumedResponseSize) {
return new SimpleHttp(url, "PUT", client, maxConsumedResponseSize); return new SimpleHttp(url, "PUT", client, maxConsumedResponseSize);
} }
public static SimpleHttp doHead(String url, KeycloakSession session) {
HttpClientProvider provider = session.getProvider(HttpClientProvider.class);
return doHead(url, provider.getHttpClient(), provider.getMaxConsumedResponseSize());
}
protected static SimpleHttp doHead(String url, HttpClient client, long maxConsumedResponseSize) { protected static SimpleHttp doHead(String url, HttpClient client, long maxConsumedResponseSize) {
return new SimpleHttp(url, "HEAD", client, maxConsumedResponseSize); return new SimpleHttp(url, "HEAD", client, maxConsumedResponseSize);
} }
public static SimpleHttp doPatch(String url, KeycloakSession session) {
HttpClientProvider provider = session.getProvider(HttpClientProvider.class);
return doPatch(url, provider.getHttpClient(), provider.getMaxConsumedResponseSize());
}
protected static SimpleHttp doPatch(String url, HttpClient client, long maxConsumedResponseSize) { protected static SimpleHttp doPatch(String url, HttpClient client, long maxConsumedResponseSize) {
return new SimpleHttp(url, "PATCH", client, maxConsumedResponseSize); return new SimpleHttp(url, "PATCH", client, maxConsumedResponseSize);
} }