public class HttpTool
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
HttpTool.HttpClientBuilder |
static class |
HttpTool.HttpDeleteBuilder |
static class |
HttpTool.HttpFormPostBuilder |
static class |
HttpTool.HttpGetBuilder |
static class |
HttpTool.HttpHeadBuilder |
static class |
HttpTool.HttpPostBuilder |
static class |
HttpTool.HttpPutBuilder |
static class |
HttpTool.TrustAllStrategy
Apache HTTP commons utility for trusting all.
|
Constructor and Description |
---|
HttpTool() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
encodeUrlParams(java.util.Map<?,?> data) |
static HttpToolResponse |
execAndConsume(org.apache.http.client.HttpClient httpClient,
org.apache.http.client.methods.HttpUriRequest req) |
static HttpTool.HttpClientBuilder |
httpClientBuilder() |
static HttpToolResponse |
httpDelete(org.apache.http.client.HttpClient httpClient,
java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> headers) |
static HttpToolResponse |
httpGet(org.apache.http.client.HttpClient httpClient,
java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> headers) |
static HttpToolResponse |
httpHead(org.apache.http.client.HttpClient httpClient,
java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> headers) |
static HttpToolResponse |
httpPost(org.apache.http.client.HttpClient httpClient,
java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> headers,
byte[] body) |
static HttpToolResponse |
httpPost(org.apache.http.client.HttpClient httpClient,
java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> headers,
java.util.Map<java.lang.String,java.lang.String> params) |
static HttpToolResponse |
httpPut(org.apache.http.client.HttpClient httpClient,
java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> headers,
byte[] body) |
static boolean |
isStatusCodeHealthy(int code) |
static java.lang.String |
toBasicAuthorizationValue(org.apache.http.auth.UsernamePasswordCredentials credentials) |
public static HttpTool.HttpClientBuilder httpClientBuilder()
public static HttpToolResponse httpGet(org.apache.http.client.HttpClient httpClient, java.net.URI uri, java.util.Map<java.lang.String,java.lang.String> headers)
public static HttpToolResponse httpPost(org.apache.http.client.HttpClient httpClient, java.net.URI uri, java.util.Map<java.lang.String,java.lang.String> headers, byte[] body)
public static HttpToolResponse httpPut(org.apache.http.client.HttpClient httpClient, java.net.URI uri, java.util.Map<java.lang.String,java.lang.String> headers, byte[] body)
public static HttpToolResponse httpPost(org.apache.http.client.HttpClient httpClient, java.net.URI uri, java.util.Map<java.lang.String,java.lang.String> headers, java.util.Map<java.lang.String,java.lang.String> params)
public static HttpToolResponse httpDelete(org.apache.http.client.HttpClient httpClient, java.net.URI uri, java.util.Map<java.lang.String,java.lang.String> headers)
public static HttpToolResponse httpHead(org.apache.http.client.HttpClient httpClient, java.net.URI uri, java.util.Map<java.lang.String,java.lang.String> headers)
public static HttpToolResponse execAndConsume(org.apache.http.client.HttpClient httpClient, org.apache.http.client.methods.HttpUriRequest req)
public static boolean isStatusCodeHealthy(int code)
public static java.lang.String toBasicAuthorizationValue(org.apache.http.auth.UsernamePasswordCredentials credentials)
public static java.lang.String encodeUrlParams(java.util.Map<?,?> data)