public interface HTTPUtil
Modifier and Type | Field and Description |
---|---|
static short |
ACTION_GET
Field
ACTION_GET |
static short |
ACTION_POST
Field
ACTION_POST |
static int |
STATUS_OK
Field
STATUS_OK |
Modifier and Type | Method and Description |
---|---|
String |
decode(String str,
String charset)
translate a url encoded string to a regular string
|
HTTPResponse |
delete(URL url,
String username,
String password,
int timeout,
String charset,
String useragent,
String proxyserver,
int proxyport,
String proxyuser,
String proxypassword,
Header[] headers) |
String |
encode(String str,
String charset)
translate a string in the URLEncoded Format
|
HTTPResponse |
get(URL url,
String username,
String password,
int timeout,
String charset,
String useragent,
String proxyserver,
int proxyport,
String proxyuser,
String proxypassword,
Header[] headers)
make a http requst to given url
|
HTTPResponse |
head(URL url,
String username,
String password,
int timeout,
String charset,
String useragent,
String proxyserver,
int proxyport,
String proxyuser,
String proxypassword,
Header[] headers) |
HTTPResponse |
put(URL url,
String username,
String password,
int timeout,
String charset,
String useragent,
String proxyserver,
int proxyport,
String proxyuser,
String proxypassword,
Header[] headers,
Object body)
Deprecated.
use instead
|
HTTPResponse |
put(URL url,
String username,
String password,
int timeout,
String mimetype,
String charset,
String useragent,
String proxyserver,
int proxyport,
String proxyuser,
String proxypassword,
Header[] headers,
Object body) |
URL |
removeUnecessaryPort(URL url)
remove port information if the port is the default port for this protocol
(http=80,https=443)
|
URI |
toURI(String strUrl) |
URI |
toURI(String strUrl,
int port) |
URL |
toURL(String strUrl)
cast a string to a url
|
URL |
toURL(String strUrl,
int port)
Deprecated.
use instead
|
URL |
toURL(String strUrl,
int port,
boolean encodeIfNecessary) |
static final short ACTION_POST
ACTION_POST
static final short ACTION_GET
ACTION_GET
static final int STATUS_OK
STATUS_OK
HTTPResponse get(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, Header[] headers) throws IOException
url
- username
- password
- timeout
- charset
- useragent
- proxyserver
- proxyport
- proxyuser
- proxypassword
- IOException
HTTPResponse put(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, Header[] headers, Object body) throws IOException
HTTPResponse put(URL url, String username, String password, int timeout, String mimetype, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, Header[] headers, Object body) throws IOException
IOException
HTTPResponse delete(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, Header[] headers) throws IOException
IOException
HTTPResponse head(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, Header[] headers) throws IOException
IOException
URL toURL(String strUrl, int port) throws MalformedURLException
strUrl
- port
- MalformedURLException
toURL(String, int, boolean)
URL toURL(String strUrl, int port, boolean encodeIfNecessary) throws MalformedURLException
strUrl
- port
- encodeIfNecessary
- MalformedURLException
URL toURL(String strUrl) throws MalformedURLException
strUrl
- string represent a urlMalformedURLException
URI toURI(String strUrl) throws URISyntaxException
URISyntaxException
URI toURI(String strUrl, int port) throws URISyntaxException
URISyntaxException
String encode(String str, String charset) throws UnsupportedEncodingException
str
- String to translatecharset
- charset used for translationUnsupportedEncodingException
String decode(String str, String charset) throws UnsupportedEncodingException
str
- encoded stringcharset
- charset usedUnsupportedEncodingException
Copyright © 2015. All rights reserved.