public class HTTPUtilImpl extends Object implements HTTPUtil
ACTION_GET, ACTION_POST, 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
|
static HTTPUtil |
getInstance() |
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) |
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) |
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)
cast a string to a url
|
URL |
toURL(String strUrl,
int port,
boolean encodeIfNecessary) |
public static HTTPUtil getInstance()
public String decode(String str, String charset) throws UnsupportedEncodingException
HTTPUtil
decode
in interface HTTPUtil
str
- encoded stringcharset
- charset usedUnsupportedEncodingException
HTTPUtil.decode(java.lang.String, java.lang.String)
public 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
public String encode(String str, String charset) throws UnsupportedEncodingException
HTTPUtil
encode
in interface HTTPUtil
str
- charset
- UnsupportedEncodingException
public 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
public 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
HTTPUtil
get
in interface HTTPUtil
IOException
HTTPUtil.get(java.net.URL, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, lucee.commons.net.http.Header[])
public 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
public 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
public URL toURL(String strUrl, int port) throws MalformedURLException
HTTPUtil
toURL
in interface HTTPUtil
strUrl
- string represent a urlMalformedURLException
public URL toURL(String strUrl, int port, boolean encodeIfNecessary) throws MalformedURLException
MalformedURLException
public URL toURL(String strUrl) throws MalformedURLException
HTTPUtil
toURL
in interface HTTPUtil
strUrl
- string represent a urlMalformedURLException
lucee.commons.net.HTTPUtil#toURL(java.lang.String)
public URI toURI(String strUrl) throws URISyntaxException
toURI
in interface HTTPUtil
URISyntaxException
public URI toURI(String strUrl, int port) throws URISyntaxException
toURI
in interface HTTPUtil
URISyntaxException
Copyright © 2015 Lucee