public class HTTPSClientUtils extends Object
| Constructor and Description |
|---|
HTTPSClientUtils() |
| Modifier and Type | Method and Description |
|---|---|
static HttpResponse |
doGet(String url,
Map<String,String> headers)
do HTTP GET operation for the given URL
|
static HttpResponse |
doPost(String url,
Map<String,String> headers,
List<org.apache.http.NameValuePair> urlParameters)
do HTTP POST operation for the given URL
|
static HttpResponse |
doPost(String url,
Map<String,String> headers,
String payload)
do HTTP POST operation for the given URL
|
static HttpResponse |
doPost(URL url,
Map<String,String> headers,
String json)
do HTTP POST operation for the given URL with JSON entity
|
static HttpResponse |
doPost(URL url,
String urlParams,
Map<String,String> headers)
do HTTP POST operation for the given URL
|
static HttpResponse |
doPut(String url,
Map<String,String> headers,
String payload)
do HTTP PUT operation for the given URL
|
static org.apache.http.impl.client.CloseableHttpClient |
getHttpsClient()
get the HTTP Client
|
static String |
getResponseBody(org.apache.http.HttpResponse response)
read the response body as String
|
public static HttpResponse doGet(String url, Map<String,String> headers) throws IOException
url - request URLheaders - headers to be sendIOException - if connection issue occurredpublic static HttpResponse doPost(String url, Map<String,String> headers, List<org.apache.http.NameValuePair> urlParameters) throws IOException
url - request URLheaders - headers to be sendurlParameters - parameters to be sent as payloadIOException - if connection issue occurredpublic static HttpResponse doPost(String url, Map<String,String> headers, String payload) throws IOException
url - request URLheaders - headers to be sentIOException - if connection issue occurredpublic static HttpResponse doPut(String url, Map<String,String> headers, String payload) throws IOException
url - request URLheaders - headers to be sentIOException - if connection issue occurredpublic static HttpResponse doPost(URL url, Map<String,String> headers, String json) throws IOException
url - headers - json - IOExceptionpublic static HttpResponse doPost(URL url, String urlParams, Map<String,String> headers) throws IOException
url - request URLheaders - headers to be sendurlParams - parameter string to be sent as payloadIOException - if connection issue occurredpublic static org.apache.http.impl.client.CloseableHttpClient getHttpsClient()
public static String getResponseBody(org.apache.http.HttpResponse response) throws IOException
response - http response with type org.apache.http.HttpResponseIOException - throws if any error occurredCopyright © 2018 WSO2 Inc. All rights reserved.