public class SimpleHttpClient extends Object
| Constructor and Description |
|---|
SimpleHttpClient() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.http.HttpResponse |
doDelete(String url,
Map<String,String> headers)
Send a HTTP DELETE request to the specified URL
|
org.apache.http.HttpResponse |
doGet(String url,
Map<String,String> headers)
Send a HTTP GET request to the specified URL
|
org.apache.http.HttpResponse |
doHead(String url,
Map<String,String> headers)
Send a HTTP Head request to the specified URL
|
org.apache.http.HttpResponse |
doOptions(String url,
Map<String,String> headers,
String payload,
String contentType)
Send a HTTP OPTIONS request to the specified URL
|
org.apache.http.HttpResponse |
doPatch(String url,
Map<String,String> headers,
String payload,
String contentType)
Send a HTTP PATCH request to the specified URL
|
org.apache.http.HttpResponse |
doPost(String url,
Map<String,String> headers,
String payload,
String contentType)
Send a HTTP POST request to the specified URL
|
org.apache.http.HttpResponse |
doPut(String url,
Map<String,String> headers,
String payload,
String contentType)
Send a HTTP PUT request to the specified URL
|
String |
getResponsePayload(org.apache.http.HttpResponse response)
Extracts the payload from a HTTP response.
|
public org.apache.http.HttpResponse doGet(String url, Map<String,String> headers) throws IOException
url - Target endpoint URLheaders - Any HTTP headers that should be added to the requestIOException - If an error occurs while making the invocationpublic org.apache.http.HttpResponse doPost(String url, Map<String,String> headers, String payload, String contentType) throws IOException
url - Target endpoint URLheaders - Any HTTP headers that should be added to the requestpayload - Content payload that should be sentcontentType - Content-type of the requestIOException - If an error occurs while making the invocationpublic String getResponsePayload(org.apache.http.HttpResponse response) throws IOException
response - HttpResponse instance to be extractedIOException - If an error occurs while reading from the responsepublic org.apache.http.HttpResponse doPatch(String url, Map<String,String> headers, String payload, String contentType) throws IOException
url - Target endpoint URLheaders - Any HTTP headers that should be added to the requestpayload - Content payload that should be sentcontentType - Content-type of the requestIOException - If an error occurs while making the invocationpublic org.apache.http.HttpResponse doOptions(String url, Map<String,String> headers, String payload, String contentType) throws IOException
url - Target endpoint URLheaders - Any HTTP headers that should be added to the requestpayload - Content payload that should be sentcontentType - Content-type of the requestIOException - If an error occurs while making the invocationpublic org.apache.http.HttpResponse doHead(String url, Map<String,String> headers) throws IOException
url - Target endpoint URLheaders - Any HTTP headers that should be added to the requestIOException - If an error occurs while making the invocationpublic org.apache.http.HttpResponse doDelete(String url, Map<String,String> headers) throws IOException
url - Target endpoint URLheaders - Any HTTP headers that should be added to the requestIOException - If an error occurs while making the invocationpublic org.apache.http.HttpResponse doPut(String url, Map<String,String> headers, String payload, String contentType) throws IOException
url - Target endpoint URLheaders - Any HTTP headers that should be added to the requestpayload - Content payload that should be sentcontentType - Content-type of the requestIOException - If an error occurs while making the invocationCopyright © 2015 WSO2 Inc. All rights reserved.