public class HttpClientUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HttpClientUtils.TrustAllStrategy
Trust all certificates.
|
Modifier and Type | Field and Description |
---|---|
static Integer |
RETRY_MAX_COUNT |
static Boolean |
RETRY_REQUEST_SEND_RETRY_ENABLED |
Modifier and Type | Method and Description |
---|---|
static ResponseEntity |
delete(String url,
Map<String,String> headers) |
static ResponseEntity |
delete(String url,
Map<String,String> headers,
org.apache.http.entity.ContentType contentType) |
static String |
encode(String url)
Encode url
|
static ResponseEntity |
execute(org.apache.http.client.methods.HttpUriRequest request)
Execute a request
|
static ResponseEntity |
get(String url,
Map<String,String> headers) |
static org.apache.http.client.HttpClient |
getHttpClient(String hostUrl) |
static String |
getMacAddress()
get mac address and port
|
static int |
getPort(String url)
get port from url
|
static String |
getServerUrl(int serverPort,
String scheme,
String serverName,
String contextPath) |
static String |
getServerUrl(org.kohsuke.stapler.StaplerRequest request) |
static ResponseEntity |
post(String url,
Map<String,String> headers,
String data) |
static ResponseEntity |
post(String url,
Map<String,String> headers,
String data,
org.apache.http.entity.ContentType contentType) |
static ResponseEntity |
put(String url,
Map<String,String> headers,
String data) |
static ResponseEntity |
put(String url,
Map<String,String> headers,
String data,
org.apache.http.entity.ContentType contentType) |
public static Integer RETRY_MAX_COUNT
public static Boolean RETRY_REQUEST_SEND_RETRY_ENABLED
public static String encode(String url)
url
- urlpublic static String getServerUrl(org.kohsuke.stapler.StaplerRequest request)
request
- requestpublic static String getServerUrl(int serverPort, String scheme, String serverName, String contextPath)
public static int getPort(String url)
url
- urlpublic static String getMacAddress() throws Exception
Exception
- Exceptionpublic static ResponseEntity get(String url, Map<String,String> headers) throws ClientRequestException
url
- urlheaders
- headersResponseEntity
ClientRequestException
- ClientRequestExceptionpublic static ResponseEntity post(String url, Map<String,String> headers, String data) throws ClientRequestException
url
- urlheaders
- headersdata
- dataResponseEntity
ClientRequestException
- ClientRequestExceptionpublic static ResponseEntity post(String url, Map<String,String> headers, String data, org.apache.http.entity.ContentType contentType) throws ClientRequestException
url
- urlheaders
- headersdata
- datacontentType
- contentTypeResponseEntity
ClientRequestException
- ClientRequestExceptionpublic static ResponseEntity put(String url, Map<String,String> headers, String data) throws ClientRequestException
url
- urlheaders
- headersdata
- dataResponseEntity
ClientRequestException
- ClientRequestExceptionpublic static ResponseEntity put(String url, Map<String,String> headers, String data, org.apache.http.entity.ContentType contentType) throws ClientRequestException
url
- urlheaders
- headersdata
- datacontentType
- contentTypeResponseEntity
ClientRequestException
- ClientRequestExceptionpublic static ResponseEntity delete(String url, Map<String,String> headers) throws ClientRequestException
url
- urlheaders
- headersResponseEntity
ClientRequestException
- ClientRequestExceptionpublic static ResponseEntity delete(String url, Map<String,String> headers, org.apache.http.entity.ContentType contentType) throws ClientRequestException
url
- urlheaders
- headerscontentType
- contentTypeResponseEntity
ClientRequestException
- ClientRequestExceptionpublic static ResponseEntity execute(org.apache.http.client.methods.HttpUriRequest request) throws ClientRequestException
request
- requestResponseEntity
ClientRequestException
- ClientRequestExceptionCopyright © 2016–2024 QASymphony. All rights reserved.