railo.runtime.util
Interface HTTPUtil

All Known Implementing Classes:
HTTPUtilImpl

public interface HTTPUtil


Field Summary
static short ACTION_GET
          Field ACTION_GET
static short ACTION_POST
          Field ACTION_POST
static int STATUS_OK
          Field STATUS_OK
 
Method Summary
 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)
           
 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
 

Field Detail

ACTION_POST

static final short ACTION_POST
Field ACTION_POST

See Also:
Constant Field Values

ACTION_GET

static final short ACTION_GET
Field ACTION_GET

See Also:
Constant Field Values

STATUS_OK

static final int STATUS_OK
Field STATUS_OK

See Also:
Constant Field Values
Method Detail

get

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
make a http requst to given url

Parameters:
url -
username -
password -
timeout -
charset -
useragent -
proxyserver -
proxyport -
proxyuser -
proxypassword -
Returns:
resulting inputstream
Throws:
IOException

put

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
Throws:
IOException

delete

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
Throws:
IOException

head

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
Throws:
IOException

toURL

URL toURL(String strUrl,
          int port)
          throws MalformedURLException
cast a string to a url

Parameters:
strUrl - string represent a url
Returns:
url from string
Throws:
MalformedURLException

toURL

URL toURL(String strUrl)
          throws MalformedURLException
cast a string to a url

Parameters:
strUrl - string represent a url
Returns:
url from string
Throws:
MalformedURLException

toURI

URI toURI(String strUrl)
          throws URISyntaxException
Throws:
URISyntaxException

toURI

URI toURI(String strUrl,
          int port)
          throws URISyntaxException
Throws:
URISyntaxException

encode

String encode(String str,
              String charset)
              throws UnsupportedEncodingException
translate a string in the URLEncoded Format

Parameters:
str - String to translate
charset - charset used for translation
Returns:
encoded String
Throws:
UnsupportedEncodingException

decode

String decode(String str,
              String charset)
              throws UnsupportedEncodingException
translate a url encoded string to a regular string

Parameters:
str - encoded string
charset - charset used
Returns:
raw string
Throws:
UnsupportedEncodingException


Copyright © 2012 Railo