Class HttpHelper
- java.lang.Object
-
- jetbrains.buildServer.vcshostings.http.HttpHelper
-
public class HttpHelper extends Object
HTTP client utility class.Note: this is an amalgamation of two previously existing, similar but differnt, versions out of pull requests and commit status publisher.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpHelper.HttpResponse
-
Field Summary
Fields Modifier and Type Field Description static String
X_OAUTH_BASIC
-
Constructor Summary
Constructors Constructor Description HttpHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E extends Exception>
voidget(String url, HttpCredentials credentials, Map<String,String> headers, int timeout, KeyStore trustStore, HttpResponseProcessor<E> processor)
static int
getHeaderInt(HttpHelper.HttpResponse response, String name)
static <E extends Exception>
voidhttp(HttpMethod httpMethod, String url, HttpCredentials credentials, String data, org.apache.http.entity.ContentType contentType, Map<String,String> headers, int timeout, KeyStore trustStore, HttpResponseProcessor<E> processor)
static <E extends Exception>
voidpatch(String url, HttpCredentials credentials, String data, org.apache.http.entity.ContentType contentType, Map<String,String> headers, int timeout, KeyStore trustStore, HttpResponseProcessor<E> processor)
static <E extends Exception>
voidpost(String url, HttpCredentials credentials, String data, org.apache.http.entity.ContentType contentType, Map<String,String> headers, int timeout, KeyStore trustStore, HttpResponseProcessor<E> processor)
static String
stripTrailingSlash(String url)
-
-
-
Field Detail
-
X_OAUTH_BASIC
public static final String X_OAUTH_BASIC
- See Also:
- Constant Field Values
-
-
Method Detail
-
post
public static <E extends Exception> void post(@NotNull String url, @Nullable HttpCredentials credentials, @Nullable String data, @Nullable org.apache.http.entity.ContentType contentType, @Nullable Map<String,String> headers, int timeout, @Nullable KeyStore trustStore, @Nullable HttpResponseProcessor<E> processor) throws IOException, E extends Exception
- Throws:
IOException
E extends Exception
-
patch
public static <E extends Exception> void patch(@NotNull String url, @Nullable HttpCredentials credentials, @Nullable String data, @Nullable org.apache.http.entity.ContentType contentType, @Nullable Map<String,String> headers, int timeout, @Nullable KeyStore trustStore, @Nullable HttpResponseProcessor<E> processor) throws IOException, E extends Exception
- Throws:
IOException
E extends Exception
-
http
public static <E extends Exception> void http(@NotNull HttpMethod httpMethod, @NotNull String url, @Nullable HttpCredentials credentials, @Nullable String data, @Nullable org.apache.http.entity.ContentType contentType, @Nullable Map<String,String> headers, int timeout, @Nullable KeyStore trustStore, @Nullable HttpResponseProcessor<E> processor) throws IOException, E extends Exception
- Throws:
IOException
E extends Exception
-
get
public static <E extends Exception> void get(@NotNull String url, @Nullable HttpCredentials credentials, @Nullable Map<String,String> headers, int timeout, @Nullable KeyStore trustStore, @Nullable HttpResponseProcessor<E> processor) throws IOException, E extends Exception
- Throws:
IOException
E extends Exception
-
getHeaderInt
public static int getHeaderInt(HttpHelper.HttpResponse response, String name)
-
-