classstableSource
@API(status = STABLE)
public final class HttpUtil

Simple yet advanced Http Utility

Methods

public static String get(String url) throws IOException, HttpException
Parameters
urlString
Returns
String
Throws
IOException
HttpException
public static String get(String url, int timeoutMs) throws IOException, HttpException
Parameters
urlString
timeoutMsint
Returns
String
Throws
IOException
HttpException
public static HttpResponse request(
    String method,
    String url,
    Map<String, String> headers,
    byte[] body,
    int connectTimeoutMs,
    int readTimeoutMs
) throws IOException, HttpException
Parameters
methodString
urlString
headersMap<String, String>
bodybyte[]
connectTimeoutMsint
readTimeoutMsint
Returns
HttpResponse
Throws
IOException
HttpException
public static HttpResponse requestJson(String method, String url, String jsonBody) throws IOException, HttpException
Parameters
methodString
urlString
jsonBodyString
Returns
HttpResponse
Throws
IOException
HttpException