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)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
File file)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
File file,
String username,
String password)
Performs an HTTP POST on the given URL.
|
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(String url,
String username,
String password)
Performs an HTTP POST on the given URL.
|
static Response |
post(URI uri)
Performs an HTTP POST on the given URI.
|
static Response |
post(URI uri,
File file)
Performs an HTTP POST on the given URL.
|
static Response |
post(URI uri,
File file,
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.
|
static Response |
post(URI uri,
String username,
String password)
Performs an HTTP POST on the given URI.
|
static Response |
put(String uriString)
Perform HTTP PUT with empty body
|
static Response |
put(String uriString,
String body,
org.apache.http.entity.ContentType contentType)
Performs an HTTP PUT on the given URL.
|
static Response |
put(String uriString,
String body,
org.apache.http.entity.ContentType contentType,
String username,
String password)
Performs an HTTP PUT on the given URL.
|
static Response |
put(String uriString,
String username,
String password)
Perform HTTP PUT with empty body
|
static Response |
put(URI uri)
Perform HTTP PUT with empty body
|
static Response |
put(URI uri,
String body,
org.apache.http.entity.ContentType contentType)
Performs an HTTP PUT on the given URL.
|
static Response |
put(URI uri,
String body,
org.apache.http.entity.ContentType contentType,
String username,
String password)
Performs an HTTP PUT on the given URL.
|
static Response |
put(URI uri,
String username,
String password)
Perform HTTP PUT with empty body
|
public static Response get(String url) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response get(String url, String username, String password) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response get(URI uri) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response get(URI uri, String username, String password) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.username - The Basic authentication username.password - The Basic authentication password.URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(String url) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
url - The URL to connect to.URISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, String username, String password) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
url - The URL to connect to.username - The Basic authentication username.password - The Basic authentication password.URISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
uri - The URI to connect to.URISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, String username, String password) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
uri - The URI to connect to.username - The Basic authentication username.password - The Basic authentication password.URISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, List<org.apache.http.NameValuePair> queryParams) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
url - The URL to connect to.queryParams - The list of NameValuePairs.URISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, List<org.apache.http.NameValuePair> queryParams, String username, String password) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
url - The URL to connect to.queryParams - The list of NameValuePairs.username - The Basic authentication username.password - The Basic authentication password.URISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, List<org.apache.http.NameValuePair> queryParams) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
uri - The URI to connect to.queryParams - The list of NameValuePairs.URISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, List<org.apache.http.NameValuePair> queryParams, String username, String password) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
uri - The URI to connect to.queryParams - The list of NameValuePairs.username - The Basic authentication username.password - The Basic authentication password.URISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, String body, org.apache.http.entity.ContentType contentType) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.body - The POST body.contentType - The ContentType of the POST body.URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, String body, org.apache.http.entity.ContentType contentType, String username, String password) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.body - The POST body.contentType - The ContentType of the POST body.username - The Basic authentication username.password - The Basic authentication password.URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, String body, org.apache.http.entity.ContentType contentType) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.body - The POST body.contentType - The ContentType of the POST body.URISyntaxExceptionorg.apache.http.HttpExceptionUnsupportedEncodingExceptionpublic static Response post(URI uri, String body, org.apache.http.entity.ContentType contentType, String username, String password) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.body - The POST body.contentType - The ContentType of the POST body.username - The Basic authentication username.password - The Basic authentication password.URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, File file) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.file - The file to send as MultiPartFile.URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, File file, String username, String password) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.file - The file to send as MultiPartFile.username - The Basic authentication username.password - The Basic authentication password.URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, File file) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.file - The file to send as MultiPartFile.URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, File file, String username, String password) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.file - The file to send as MultiPartFile.username - The Basic authentication username.password - The Basic authentication password.URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(URI uri) throws URISyntaxException, org.apache.http.HttpException
uri - org.apache.http.HttpExceptionURISyntaxExceptionpublic static Response put(String uriString) throws URISyntaxException, org.apache.http.HttpException
uriString - org.apache.http.HttpExceptionURISyntaxExceptionpublic static Response put(URI uri, String username, String password) throws URISyntaxException, org.apache.http.HttpException
uri - username - password - URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(String uriString, String username, String password) throws URISyntaxException, org.apache.http.HttpException
uriString - org.apache.http.HttpExceptionURISyntaxExceptionpublic static Response put(String uriString, String body, org.apache.http.entity.ContentType contentType) throws URISyntaxException, org.apache.http.HttpException
uriString - body - contentType - URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(String uriString, String body, org.apache.http.entity.ContentType contentType, String username, String password) throws URISyntaxException, org.apache.http.HttpException
uriString - body - contentType - username - The Basic authentication username. No basic auth if null.password - The Basic authentication password. No basic auth if null.URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(URI uri, String body, org.apache.http.entity.ContentType contentType) throws URISyntaxException, org.apache.http.HttpException
uri - body - contentType - URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(URI uri, String body, org.apache.http.entity.ContentType contentType, String username, String password) throws URISyntaxException, org.apache.http.HttpException
uri - body - contentType - username - The Basic authentication username. No basic auth if null.password - The Basic authentication password. No basic auth if null.URISyntaxExceptionorg.apache.http.HttpExceptionCopyright © 2016 terrestris GmbH & Co. KG. All rights reserved.