WebClient

A simple web browser simulator.

Methods
String get(String url)
Open an URL and get the HTML data.
String get(String url) throws IOException
Open an URL and get the HTML data.
Parameters:
url - the HTTP URL
Returns:
the HTML as a string
String get(String url, String page)
Read the specified HTML page.
String get(String url, String page) throws IOException
Read the specified HTML page.
Parameters:
url - the base URL
page - the page to read
Returns:
the HTML page
String getBaseUrl(String url)
Get the base URL (the host name and port).
String getBaseUrl(String url)
Get the base URL (the host name and port).
Parameters:
url - the complete URL
Returns:
the host name and port
String getContentType()
String getContentType()
String readSessionId(String url)
Read the session ID from a URL.
String readSessionId(String url)
Read the session ID from a URL.
Parameters:
url - the URL
Returns:
the session id
void setAcceptLanguage(String acceptLanguage)
void setAcceptLanguage(String acceptLanguage)
String upload(String url, String fileName, InputStream in)
Upload a file.
String upload(String url, String fileName, InputStream in) throws IOException
Upload a file.
Parameters:
url - the target URL
fileName - the file name to post
in - the input stream
Returns:
the result