public class HttpUtil extends Object
| Constructor and Description |
|---|
HttpUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Response |
get(String url)
Performs an HTTP GET on the given URL.
|
static Response |
get(String url,
String username,
String password)
Performs an HTTP GET on the given URL.
|
static Response |
get(URI uri)
Performs an HTTP GET on the given URI.
|
static Response |
get(URI uri,
String username,
String password)
Performs an HTTP GET on the given URI.
|
static Response |
post(String url,
List<org.apache.http.NameValuePair> queryParams)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
List<org.apache.http.NameValuePair> queryParams,
String username,
String password)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
String body,
org.apache.http.entity.ContentType contentType)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
String body,
org.apache.http.entity.ContentType contentType,
String username,
String password)
Performs an HTTP POST on the given URL.
|
static Response |
post(URI uri,
List<org.apache.http.NameValuePair> queryParams)
Performs an HTTP POST on the given URI.
|
static Response |
post(URI uri,
List<org.apache.http.NameValuePair> queryParams,
String username,
String password)
Performs an HTTP POST on the given URI.
|
static Response |
post(URI uri,
String body,
org.apache.http.entity.ContentType contentType)
Performs an HTTP POST on the given URL.
|
static Response |
post(URI uri,
String body,
org.apache.http.entity.ContentType contentType,
String username,
String password)
Performs an HTTP POST on the given URL.
|
public static Response get(String url) throws URISyntaxException
url - The URL to connect to.URISyntaxExceptionpublic static Response get(String url, String username, String password) throws URISyntaxException
url - The URL to connect to.URISyntaxExceptionpublic static Response get(URI uri) throws URISyntaxException
uri - The URI to connect to.URISyntaxExceptionpublic static Response get(URI uri, String username, String password) throws URISyntaxException
uri - The URI to connect to.username - The Basic authentication username.password - The Basic authentication password.URISyntaxExceptionpublic static Response post(String url, List<org.apache.http.NameValuePair> queryParams) throws URISyntaxException, UnsupportedEncodingException
url - The URL to connect to.queryParams - URISyntaxExceptionUnsupportedEncodingExceptionpublic static Response post(String url, List<org.apache.http.NameValuePair> queryParams, String username, String password) throws URISyntaxException, UnsupportedEncodingException
url - The URL to connect to.queryParams - username - The Basic authentication username.password - The Basic authentication password.URISyntaxExceptionUnsupportedEncodingExceptionpublic static Response post(URI uri, List<org.apache.http.NameValuePair> queryParams) throws URISyntaxException, UnsupportedEncodingException
uri - The URI to connect to.queryParams - URISyntaxExceptionUnsupportedEncodingExceptionpublic static Response post(URI uri, List<org.apache.http.NameValuePair> queryParams, String username, String password) throws URISyntaxException, UnsupportedEncodingException
uri - The URI to connect to.queryParams - username - The Basic authentication username.password - The Basic authentication password.URISyntaxExceptionUnsupportedEncodingExceptionpublic static Response post(String url, String body, org.apache.http.entity.ContentType contentType) throws URISyntaxException
url - The URL to connect to.body - contentType - URISyntaxExceptionpublic static Response post(String url, String body, org.apache.http.entity.ContentType contentType, String username, String password) throws URISyntaxException
url - The URL to connect to.body - contentType - username - The Basic authentication username.password - The Basic authentication password.URISyntaxExceptionpublic static Response post(URI uri, String body, org.apache.http.entity.ContentType contentType) throws URISyntaxException
uri - The URI to connect to.queryParams - URISyntaxExceptionUnsupportedEncodingExceptionpublic static Response post(URI uri, String body, org.apache.http.entity.ContentType contentType, String username, String password) throws URISyntaxException
uri - The URI to connect to.body - contentType - username - The Basic authentication username.password - The Basic authentication password.URISyntaxExceptionCopyright © 2016 terrestris GmbH & Co. KG. All rights reserved.