public class HttpClient extends Object
| Constructor and Description |
|---|
HttpClient() |
| Modifier and Type | Method and Description |
|---|---|
static void |
configFollowRedirects(boolean b)
Global "Follow Redirects" configuration
|
static void |
configProxy(String proxyHost,
String proxyPort)
Global proxy configuration
|
static void |
configTrustStore(String trustStoreFile,
String trustStorePassword) |
HttpClientResponse |
delete(String url) |
HttpClientResponse |
delete(URL url) |
HttpClientResponse |
get(String url) |
HttpClientResponse |
get(URL url) |
static boolean |
getConfigFollowRedirects()
Returns the global "Follow Redirects" configuration
|
boolean |
getFollowRedirects() |
HttpClientResponse |
head(String url) |
HttpClientResponse |
head(URL url) |
HttpClientResponse |
post(String url,
byte[] data) |
HttpClientResponse |
post(String url,
String data) |
HttpClientResponse |
post(URL url,
byte[] data) |
HttpClientResponse |
put(String url,
byte[] data) |
HttpClientResponse |
put(String url,
String data) |
HttpClientResponse |
put(URL url,
byte[] data) |
void |
setFollowRedirects(boolean b)
Set the "Follow Redirects" flag for this instance
|
public HttpClientResponse get(String url) throws Exception
Exceptionpublic HttpClientResponse get(URL url) throws Exception
Exceptionpublic HttpClientResponse head(String url) throws Exception
Exceptionpublic HttpClientResponse head(URL url) throws Exception
Exceptionpublic HttpClientResponse post(String url, String data) throws Exception
Exceptionpublic HttpClientResponse post(String url, byte[] data) throws Exception
Exceptionpublic HttpClientResponse post(URL url, byte[] data) throws Exception
Exceptionpublic HttpClientResponse put(String url, String data) throws Exception
Exceptionpublic HttpClientResponse put(String url, byte[] data) throws Exception
Exceptionpublic HttpClientResponse put(URL url, byte[] data) throws Exception
Exceptionpublic HttpClientResponse delete(String url) throws Exception
Exceptionpublic HttpClientResponse delete(URL url) throws Exception
Exceptionpublic static void configFollowRedirects(boolean b)
b - public static boolean getConfigFollowRedirects()
public static void configProxy(String proxyHost, String proxyPort)
proxyHost - : example "myproxy"proxyPort - : example ""public static void configTrustStore(String trustStoreFile, String trustStorePassword)
public void setFollowRedirects(boolean b)
b - public boolean getFollowRedirects()
Copyright © 2016. All rights reserved.