|
Secure iNet Factory | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jscape.inet.http.HttpSession
public class HttpSession
Implements the basic functionality of an HTTP client automatically managing all session data in memory.
Example:
HttpSession session = new HttpSession(); HttpResponse response1 = session.getResponse("http://www.mydomain.com/page1"); HttpResponse response2 = session.getResponse("http://www.mydomain.com/page2"); HttpRequest page3 = new HttpRequest("http://www.mydomain.com/page3"); page3.addParameter("username","jsmith"); page3.addParameter("password","secret"); * HttpResponse response3 = session.getResponse(page3);
Constructor Summary | |
---|---|
HttpSession()
Creates a new HttpSession instance. |
|
HttpSession(Http http)
Creates a new HttpSession instance. |
Method Summary | |
---|---|
java.util.Vector |
getCookiesForHost(java.lang.String host)
Gets all cookies for the specified hostname |
java.io.PrintStream |
getDebugStream()
Gets debug stream used for debug messages. |
HttpResponse |
getResponse(HttpRequest request)
Gets response from HTTP server. |
HttpResponse |
getResponse(java.lang.String url)
Gets response from HTTP server. |
HttpResponse |
getResponse(java.lang.String url,
java.lang.String method)
Gets response from HTTP server. |
boolean |
isAllowCookies()
Checks if cookies are allowed to be stored in memory. |
boolean |
isDebug()
Checks if debugging is enabled. |
void |
setAllowCookies(boolean allowCookies)
Sets whether cookies are allowed to be stored in memory. |
void |
setDebug(boolean debug)
Enables or disables debugging. |
void |
setDebugStream(java.io.PrintStream debugStream)
Sets debug stream to be used for debug messages. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpSession()
public HttpSession(Http http)
http
- an Http instance.Http
Method Detail |
---|
public HttpResponse getResponse(java.lang.String url, java.lang.String method) throws HttpException
url
- the web address to retrievemethod
- the method, valid values are GET and POST
HttpException
- if an I/O or HTTP related error occurspublic HttpResponse getResponse(java.lang.String url) throws HttpException
url
- the web address to retrieve
HttpException
- if an I/O or HTTP related error occurspublic HttpResponse getResponse(HttpRequest request) throws HttpException
request
- an HttpRequest
HttpException
- if an I/O or HTTP related error occurspublic java.util.Vector getCookiesForHost(java.lang.String host)
host
- the hostname to find cookies for
public boolean isAllowCookies()
public void setAllowCookies(boolean allowCookies)
allowCookies
- true if cookies are allowed, false otherwisepublic void setDebug(boolean debug)
debug
- true if enabled, false otherwise.public boolean isDebug()
public void setDebugStream(java.io.PrintStream debugStream)
debugStream
- a PrintStreamPrintStream
public java.io.PrintStream getDebugStream()
PrintStream
|
Secure iNet Factory | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |