@Component public class HttpUtil extends Object
| Constructor and Description |
|---|
HttpUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Response |
delete(String url)
Performs an HTTP DELETE on the given URL.
|
static Response |
delete(String url,
org.apache.http.auth.Credentials credentials)
Performs an HTTP DELETE on the given URL.
|
static Response |
delete(String url,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
Performs an HTTP DELETE on the given URL.
|
static Response |
delete(String url,
org.apache.http.Header[] requestHeaders)
Performs an HTTP DELETE on the given URL.
|
static Response |
delete(String url,
String username,
String password)
Performs an HTTP DELETE on the given URL.
|
static Response |
delete(String url,
String username,
String password,
org.apache.http.Header[] requestHeaders)
Performs an HTTP DELETE on the given URL.
|
static Response |
delete(URI uri)
Performs an HTTP DELETE on the given URI.
|
static Response |
delete(URI uri,
org.apache.http.auth.Credentials credentials)
Performs an HTTP DELETE on the given URI.
|
static Response |
delete(URI uri,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
Performs an HTTP DELETE on the given URI.
|
static Response |
delete(URI uri,
org.apache.http.Header[] requestHeaders)
Performs an HTTP DELETE on the given URI.
|
static Response |
delete(URI uri,
String username,
String password)
Performs an HTTP DELETE on the given URI.
|
static Response |
delete(URI uri,
String username,
String password,
org.apache.http.Header[] requestHeaders)
Performs an HTTP DELETE on the given URI.
|
static Response |
forwardFormMultipartPost(URI uri,
javax.servlet.http.HttpServletRequest request,
boolean forwardHeaders)
Forward FormMultipartPost (HTTP POST) to uri based on given request
|
static Response |
forwardGet(URI uri,
javax.servlet.http.HttpServletRequest request,
boolean forwardHeaders)
Forward GET request to uri based on given request
|
static Response |
forwardPost(URI uri,
javax.servlet.http.HttpServletRequest request,
boolean forwardHeaders)
Forward POST to uri based on given request
|
static Response |
get(String url)
Performs an HTTP GET on the given URL without authentication
|
static Response |
get(String url,
org.apache.http.auth.Credentials credentials)
Performs an HTTP GET on the given URL.
|
static Response |
get(String url,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
Performs an HTTP GET on the given URL.
|
static Response |
get(String url,
org.apache.http.Header[] requestHeaders)
Performs an HTTP GET on the given URL without authentication and
additional HTTP request headers.
|
static Response |
get(String url,
String username,
String password)
Performs an HTTP GET on the given URL
|
static Response |
get(String url,
String username,
String password,
org.apache.http.Header[] requestHeaders)
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,
org.apache.http.auth.Credentials credentials)
Performs an HTTP GET on the given URI.
|
static Response |
get(URI uri,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
Performs an HTTP GET on the given URI.
|
static Response |
get(URI uri,
org.apache.http.Header[] requestHeaders)
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 |
get(URI uri,
String username,
String password,
org.apache.http.Header[] requestHeaders)
Performs an HTTP GET on the given URI.
|
static org.apache.http.Header[] |
getHeadersFromRequest(javax.servlet.http.HttpServletRequest request)
Extract headers from
HttpServletRequest |
static int |
getHttpTimeout() |
static boolean |
isFormMultipartPost(javax.servlet.http.HttpServletRequest request)
Check if provided
HttpServletRequest is a FormMultipartPost |
static boolean |
isHttpGetRequest(javax.servlet.http.HttpServletRequest request)
Check if provided
HttpServletRequest is a HTTP GET request |
static boolean |
isHttpPostRequest(javax.servlet.http.HttpServletRequest request)
Check if provided
HttpServletRequest is a HTTP POST request |
static boolean |
isSaneRequest(javax.servlet.http.HttpServletRequest request)
Checks if request and request method are not null
|
static Response |
post(String url)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
org.apache.http.auth.Credentials credentials)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
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,
org.apache.http.auth.Credentials credentials)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
File file,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
File file,
org.apache.http.Header[] requestHeaders)
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,
File file,
String username,
String password,
org.apache.http.Header[] requestHeaders)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
org.apache.http.Header[] requestHeaders)
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,
org.apache.http.auth.Credentials credentials)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
List<org.apache.http.NameValuePair> queryParams,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
List<org.apache.http.NameValuePair> queryParams,
org.apache.http.Header[] requestHeaders)
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,
List<org.apache.http.NameValuePair> queryParams,
String username,
String password,
org.apache.http.Header[] requestHeaders)
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,
org.apache.http.auth.Credentials credentials)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
String body,
org.apache.http.entity.ContentType contentType,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
String body,
org.apache.http.entity.ContentType contentType,
org.apache.http.Header[] requestHeaders)
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 body,
org.apache.http.entity.ContentType contentType,
String username,
String password,
org.apache.http.Header[] requestHeaders)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
String password,
String username)
Performs an HTTP POST on the given URL.
|
static Response |
post(String url,
String password,
String username,
org.apache.http.Header[] requestHeaders)
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,
org.apache.http.auth.Credentials credentials)
Performs an HTTP POST on the given URI.
|
static Response |
post(URI uri,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
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,
org.apache.http.auth.Credentials credentials)
Performs an HTTP POST on the given URL.
|
static Response |
post(URI uri,
File file,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
Performs an HTTP POST on the given URL.
|
static Response |
post(URI uri,
File file,
org.apache.http.Header[] requestHeaders)
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,
File file,
String username,
String password,
org.apache.http.Header[] requestHeaders)
Performs an HTTP POST on the given URL.
|
static Response |
post(URI uri,
org.apache.http.Header[] requestHeaders)
Performs an HTTP POST on the given URI.
|
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,
org.apache.http.auth.Credentials credentials)
Performs an HTTP POST on the given URI.
|
static Response |
post(URI uri,
List<org.apache.http.NameValuePair> queryParams,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
Performs an HTTP POST on the given URI.
|
static Response |
post(URI uri,
List<org.apache.http.NameValuePair> queryParams,
org.apache.http.Header[] requestHeaders)
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,
List<org.apache.http.NameValuePair> queryParams,
String username,
String password,
org.apache.http.Header[] requestHeaders)
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,
org.apache.http.auth.Credentials credentials)
Performs an HTTP POST on the given URL.
|
static Response |
post(URI uri,
String body,
org.apache.http.entity.ContentType contentType,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
Performs an HTTP POST on the given URL.
|
static Response |
post(URI uri,
String body,
org.apache.http.entity.ContentType contentType,
org.apache.http.Header[] requestHeaders)
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 body,
org.apache.http.entity.ContentType contentType,
String username,
String password,
org.apache.http.Header[] requestHeaders)
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 |
post(URI uri,
String username,
String password,
org.apache.http.Header[] requestHeaders)
Performs an HTTP POST on the given URI.
|
static Response |
put(String uriString)
Perform HTTP PUT with empty body
|
static Response |
put(String uriString,
org.apache.http.auth.Credentials credentials)
Perform HTTP PUT with empty body
|
static Response |
put(String uriString,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
Perform HTTP PUT with empty body
|
static Response |
put(String uriString,
File body,
org.apache.http.entity.ContentType contentType,
String username,
String password)
Performs an HTTP PUT on the given URL.
|
static Response |
put(String uriString,
org.apache.http.Header[] requestHeaders)
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,
org.apache.http.auth.Credentials credentials)
Performs an HTTP PUT on the given URL.
|
static Response |
put(String uriString,
String body,
org.apache.http.entity.ContentType contentType,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
Performs an HTTP PUT on the given URL.
|
static Response |
put(String uriString,
String body,
org.apache.http.entity.ContentType contentType,
org.apache.http.Header[] requestHeaders)
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 body,
org.apache.http.entity.ContentType contentType,
String username,
String password,
org.apache.http.Header[] requestHeaders)
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(String uriString,
String username,
String password,
org.apache.http.Header[] requestHeaders)
Perform HTTP PUT with empty body
|
static Response |
put(URI uri)
Perform HTTP PUT with empty body
|
static Response |
put(URI uri,
org.apache.http.auth.Credentials credentials)
Perform HTTP PUT with empty body
|
static Response |
put(URI uri,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
Perform HTTP PUT with empty body
|
static Response |
put(URI uri,
org.apache.http.Header[] requestHeaders)
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,
org.apache.http.auth.Credentials credentials)
Performs an HTTP PUT on the given URL.
|
static Response |
put(URI uri,
String body,
org.apache.http.entity.ContentType contentType,
org.apache.http.auth.Credentials credentials,
org.apache.http.Header[] requestHeaders)
Performs an HTTP PUT on the given URL.
|
static Response |
put(URI uri,
String body,
org.apache.http.entity.ContentType contentType,
org.apache.http.Header[] requestHeaders)
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 body,
org.apache.http.entity.ContentType contentType,
String username,
String password,
org.apache.http.Header[] requestHeaders)
Performs an HTTP PUT on the given URL.
|
static Response |
put(URI uri,
String username,
String password)
Perform HTTP PUT with empty body
Basic auth will be used if both username and password are not null
|
static Response |
put(URI uri,
String username,
String password,
org.apache.http.Header[] requestHeaders)
Perform HTTP PUT with empty body
Basic auth will be used if both username and password are not null
|
static void |
resetHttpTimeout()
Resets the http timeout to the default one given by the app config.
|
void |
setDefaultHttpTimeout(int httpTimeout)
Note: The value annotation is set to the setter of httpTimeout here as
we can't autowire any value to its static field (but the field has to be
static itself).
|
static void |
setHttpTimeout(int httpTimeout) |
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, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response get(String url, org.apache.http.auth.Credentials credentials) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.credentials - instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response get(String url, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.credentials - instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response get(String url, String username, String password) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.username - Credentials - usernamepassword - Credentials - passwordorg.apache.http.HttpExceptionURISyntaxExceptionpublic static Response get(String url, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.username - Credentials - usernamepassword - Credentials - passwordrequestHeaders - Additional HTTP headers added to the requestorg.apache.http.HttpExceptionURISyntaxExceptionpublic 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, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.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 - Credentials - usernamepassword - Credentials - passwordURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response get(URI uri, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.username - Credentials - usernamepassword - Credentials - passwordrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response get(URI uri, org.apache.http.auth.Credentials credentials) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.credentials - Instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response get(URI uri, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.credentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response forwardGet(URI uri, javax.servlet.http.HttpServletRequest request, boolean forwardHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - uri The URI to forward to.request - The original HttpServletRequestforwardHeaders - Should headers of request should be forwardedURISyntaxExceptionorg.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, org.apache.http.Header[] requestHeaders) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
url - The URL to connect to.requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, String password, String username) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
url - The URI to connect to as String.username - Credentials - usernamepassword - Credentials - passwordURISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, String password, String username, org.apache.http.Header[] requestHeaders) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
url - The URI to connect to as String.username - Credentials - usernamepassword - Credentials - passwordrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, org.apache.http.auth.Credentials credentials) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
url - The URL to connect to.credentials - Instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
url - The URL to connect to.credentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionUnsupportedEncodingExceptionorg.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, org.apache.http.Header[] requestHeaders) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
uri - The URI to connect to.requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionUnsupportedEncodingExceptionorg.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 - Credentials - usernamepassword - Credentials - passwordURISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
uri - The URI to connect to.username - Credentials - usernamepassword - Credentials - passwordrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, org.apache.http.auth.Credentials credentials) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
uri - The URI to connect to.credentials - Instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
uri - The URI to connect to.credentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionUnsupportedEncodingExceptionorg.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, org.apache.http.Header[] requestHeaders) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
url - The URL to connect to.queryParams - The list of NameValuePairs.requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionUnsupportedEncodingExceptionorg.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 - Credentials - usernamepassword - Credentials - passwordURISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, List<org.apache.http.NameValuePair> queryParams, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
url - The URL to connect to.queryParams - The list of NameValuePairs.username - Credentials - usernamepassword - Credentials - passwordrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, List<org.apache.http.NameValuePair> queryParams, org.apache.http.auth.Credentials credentials) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
url - The URL to connect to.queryParams - The list of NameValuePairs.credentials - Instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, List<org.apache.http.NameValuePair> queryParams, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
url - The URL to connect to.queryParams - The list of NameValuePairs.credentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionUnsupportedEncodingExceptionorg.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, org.apache.http.Header[] requestHeaders) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
uri - The URI to connect to.queryParams - The list of NameValuePairs.requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionUnsupportedEncodingExceptionorg.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 - Credentials - usernamepassword - Credentials - passwordURISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, List<org.apache.http.NameValuePair> queryParams, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
uri - The URI to connect to.queryParams - The list of NameValuePairs.username - Credentials - usernamepassword - Credentials - passwordrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, List<org.apache.http.NameValuePair> queryParams, org.apache.http.auth.Credentials credentials) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
uri - The URI to connect to.queryParams - The list of NameValuePairs.credentials - Instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionUnsupportedEncodingExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, List<org.apache.http.NameValuePair> queryParams, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, UnsupportedEncodingException, org.apache.http.HttpException
uri - The URI to connect to.queryParams - The list of NameValuePairs.credentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionUnsupportedEncodingExceptionorg.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, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.body - The POST body.contentType - The ContentType of the POST body.requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.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 bodyusername - Credentials - usernamepassword - Credentials - passwordURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, String body, org.apache.http.entity.ContentType contentType, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.body - The POST body.contentType - The ContentType of the POST bodyusername - Credentials - usernamepassword - Credentials - passwordrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, String body, org.apache.http.entity.ContentType contentType, org.apache.http.auth.Credentials credentials) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.body - The POST body.contentType - The ContentType of the POST body.credentials - Instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, String body, org.apache.http.entity.ContentType contentType, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.body - The POST body.contentType - The ContentType of the POST body.credentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.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.HttpExceptionpublic static Response post(URI uri, String body, org.apache.http.entity.ContentType contentType, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.body - The POST body.contentType - The ContentType of the POST body.requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic 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 - Credentials - usernamepassword - Credentials - passwordURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, String body, org.apache.http.entity.ContentType contentType, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.body - The POST body.contentType - The ContentType of the POST body.username - Credentials - usernamepassword - Credentials - passwordrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, String body, org.apache.http.entity.ContentType contentType, org.apache.http.auth.Credentials credentials) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.body - The POST body.contentType - The ContentType of the POST body.credentials - Instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, String body, org.apache.http.entity.ContentType contentType, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.body - The POST body.contentType - The ContentType of the POST body.credentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.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, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.file - The file to send as MultiPartFile.requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.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 - usernamepassword - passwordURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, File file, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.file - The file to send as MultiPartFile.username - usernamepassword - passwordrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, File file, org.apache.http.auth.Credentials credentials) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.file - The file to send as MultiPartFile.credentials - Instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(String url, File file, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.file - The file to send as MultiPartFile.credentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.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, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.file - The file to send as MultiPartFile.requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.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 - usernamepassword - passwordURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, File file, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.file - The file to send as MultiPartFile.username - usernamepassword - passwordrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, File file, org.apache.http.auth.Credentials credentials) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.file - The file to send as MultiPartFile.credentials - Instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response post(URI uri, File file, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.file - The file to send as MultiPartFile.credentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response forwardFormMultipartPost(URI uri, javax.servlet.http.HttpServletRequest request, boolean forwardHeaders) throws URISyntaxException, org.apache.http.HttpException, IllegalStateException, IOException, javax.servlet.ServletException
uri - uri The URI to forward to.request - The original HttpServletRequestforwardHeaders - Should headers of request should be forwardedURISyntaxExceptionorg.apache.http.HttpExceptionIllegalStateExceptionIOExceptionjavax.servlet.ServletExceptionpublic static Response forwardPost(URI uri, javax.servlet.http.HttpServletRequest request, boolean forwardHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - uri The URI to forward to.request - The original HttpServletRequestforwardHeaders - Should headers of request should be forwardedURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(URI uri) throws URISyntaxException, org.apache.http.HttpException
uri - org.apache.http.HttpExceptionURISyntaxExceptionpublic static Response put(URI uri, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - requestHeaders - Additional HTTP headers added to the requestorg.apache.http.HttpExceptionURISyntaxExceptionpublic static Response put(String uriString) throws URISyntaxException, org.apache.http.HttpException
uriString - org.apache.http.HttpExceptionURISyntaxExceptionpublic static Response put(String uriString, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uriString - requestHeaders - Additional HTTP headers added to the requestorg.apache.http.HttpExceptionURISyntaxExceptionpublic static Response put(URI uri, String username, String password) throws URISyntaxException, org.apache.http.HttpException
uri - URI to connect tousername - usernamepassword - passwordURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(URI uri, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - URI to connect tousername - usernamepassword - passwordrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(URI uri, org.apache.http.auth.Credentials credentials) throws URISyntaxException, org.apache.http.HttpException
uri - URI to connect tocredentials - Instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(URI uri, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - URI to connect tocredentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(String uriString, String username, String password) throws URISyntaxException, org.apache.http.HttpException
uriString - String representing the URI to connect tousername - usernamepassword - passwordorg.apache.http.HttpExceptionURISyntaxExceptionpublic static Response put(String uriString, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uriString - String representing the URI to connect tousername - usernamepassword - passwordrequestHeaders - Additional HTTP headers added to the requestorg.apache.http.HttpExceptionURISyntaxExceptionpublic static Response put(String uriString, org.apache.http.auth.Credentials credentials) throws URISyntaxException, org.apache.http.HttpException
uriString - String representing the URI to connect tocredentials - Instance implementing Credentials interface holding a set of credentialsorg.apache.http.HttpExceptionURISyntaxExceptionpublic static Response put(String uriString, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uriString - String representing the URI to connect tocredentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestorg.apache.http.HttpExceptionURISyntaxExceptionpublic static Response put(String uriString, String body, org.apache.http.entity.ContentType contentType) throws URISyntaxException, org.apache.http.HttpException
uriString - String representing the URI to connect tobody - contentType - URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(String uriString, String body, org.apache.http.entity.ContentType contentType, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uriString - String representing the URI to connect tobody - contentType - requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.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 - String representing the URI to connect tobody - contentType - username - password - URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(String uriString, String body, org.apache.http.entity.ContentType contentType, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uriString - String representing the URI to connect tobody - contentType - username - password - requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(String uriString, String body, org.apache.http.entity.ContentType contentType, org.apache.http.auth.Credentials credentials) throws URISyntaxException, org.apache.http.HttpException
uriString - body - contentType - credentials - Instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(String uriString, String body, org.apache.http.entity.ContentType contentType, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uriString - body - contentType - credentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.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, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - body - contentType - requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.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 - password - URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(URI uri, String body, org.apache.http.entity.ContentType contentType, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - body - contentType - username - password - requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(String uriString, File body, org.apache.http.entity.ContentType contentType, String username, String password) throws URISyntaxException, org.apache.http.HttpException
uriString - body - username - password - URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(URI uri, String body, org.apache.http.entity.ContentType contentType, org.apache.http.auth.Credentials credentials) throws URISyntaxException, org.apache.http.HttpException
uri - body - contentType - credentials - Instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response put(URI uri, String body, org.apache.http.entity.ContentType contentType, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - body - contentType - credentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response delete(String url) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response delete(String url, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response delete(String url, String username, String password) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.username - usernamepassword - passwordURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response delete(String url, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.username - usernamepassword - passwordrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response delete(String url, org.apache.http.auth.Credentials credentials) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.credentials - Instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response delete(String url, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
url - The URL to connect to.credentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response delete(URI uri) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.URISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response delete(URI uri, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.requestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response delete(URI uri, String username, String password) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.username - usernamepassword - passwordURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response delete(URI uri, String username, String password, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.username - usernamepassword - passwordrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response delete(URI uri, org.apache.http.auth.Credentials credentials) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.credentials - Instance implementing Credentials interface holding a set of credentialsURISyntaxExceptionorg.apache.http.HttpExceptionpublic static Response delete(URI uri, org.apache.http.auth.Credentials credentials, org.apache.http.Header[] requestHeaders) throws URISyntaxException, org.apache.http.HttpException
uri - The URI to connect to.credentials - Instance implementing Credentials interface holding a set of credentialsrequestHeaders - Additional HTTP headers added to the requestURISyntaxExceptionorg.apache.http.HttpExceptionpublic static boolean isSaneRequest(javax.servlet.http.HttpServletRequest request)
request - HttpServletRequest to checkpublic static boolean isHttpGetRequest(javax.servlet.http.HttpServletRequest request)
HttpServletRequest is a HTTP GET requestrequest - HttpServletRequest to checkpublic static boolean isHttpPostRequest(javax.servlet.http.HttpServletRequest request)
HttpServletRequest is a HTTP POST requestrequest - HttpServletRequest to checkpublic static boolean isFormMultipartPost(javax.servlet.http.HttpServletRequest request)
HttpServletRequest is a FormMultipartPostrequest - HttpServletRequest to checkpublic static org.apache.http.Header[] getHeadersFromRequest(javax.servlet.http.HttpServletRequest request)
HttpServletRequestrequest - HttpServletRequest to extract headers fromHeaderspublic static int getHttpTimeout()
public static void setHttpTimeout(int httpTimeout)
httpTimeout - the httpTimeout to setpublic static void resetHttpTimeout()
@Value(value="${http.timeout}")
public void setDefaultHttpTimeout(int httpTimeout)
httpTimeout - the httpTimeout to setCopyright © 2020 terrestris GmbH & Co. KG. All rights reserved.