|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.quadrique.jbuildingblocks.core.io.http.client.JbbHttpClient
public class JbbHttpClient
This class provides convenience routines to simplify and streamline the request/response handling HTTP communications. The actual HTTP layer is based on the Apache HttpClient package.
| Method Summary | |
|---|---|
JbbHttpResponse |
authenticate(String urlStr,
String username,
String password,
HashMap<String,String> headers,
HashMap<String,String> params,
boolean followRedirects,
int timeout)
This method automatically handles authentication. |
JbbHttpResponse |
get(String url,
HashMap<String,String> headers,
HashMap<String,String> params,
boolean followRedirects,
int timeout)
http get method sent to server url. |
static JbbHttpClient |
getInstance()
|
JbbHttpResponse |
head(String url,
HashMap<String,String> headers,
HashMap<String,String> params,
boolean followRedirects,
int timeout)
http get method sent to server url. |
JbbHttpResponse |
login(String url,
HashMap<String,String> headers,
HashMap<String,String> params,
boolean followRedirects,
int timeout)
http login method will post username and password (required identity parameters) and will automatically takes care of the url redirectng which is the case for most of the sites that require login. |
JbbHttpResponse |
multipartRequest(String url,
HashMap<String,String> headers,
HashMap<String,String> params,
File[] files,
boolean followRedirects,
int timeout)
posts multiple files to the specified url. |
JbbHttpResponse |
post(String url,
HashMap<String,String> headers,
HashMap<String,String> params,
boolean followRedirects,
int timeout)
http post method sent to server url. |
JbbHttpResponse |
postFile(String url,
HashMap<String,String> headers,
String fileName,
boolean followRedirects,
int timeout)
posts given file to the server url. |
JbbHttpResponse |
postXml(String url,
HashMap<String,String> headers,
String serializedXmlDocument,
boolean followRedirects,
int timeout)
posts xml to the server url. |
JbbHttpResponse |
postXml(String url,
HashMap<String,String> headers,
String serializedXmlDocument,
boolean followRedirects,
int timeout,
String postEncoding)
posts xml to the server url using the given encoding (e.g. |
void |
setMaxConnections(int maxConnections)
|
void |
setRetryHandler(org.apache.commons.httpclient.HttpMethodRetryHandler retryHandler)
setter methods ** |
void |
setTimeout(int timeout)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static JbbHttpClient getInstance()
public void setRetryHandler(org.apache.commons.httpclient.HttpMethodRetryHandler retryHandler)
public void setTimeout(int timeout)
public void setMaxConnections(int maxConnections)
public JbbHttpResponse login(String url,
HashMap<String,String> headers,
HashMap<String,String> params,
boolean followRedirects,
int timeout)
throws Exception
url - headers - params - followRedirects - timeout -
Exception
public JbbHttpResponse head(String url,
HashMap<String,String> headers,
HashMap<String,String> params,
boolean followRedirects,
int timeout)
throws Exception
url - headers - params - followRedirects - timeout -
Exception
public JbbHttpResponse get(String url,
HashMap<String,String> headers,
HashMap<String,String> params,
boolean followRedirects,
int timeout)
throws Exception
url - headers - params - followRedirects - timeout -
Exception
public JbbHttpResponse authenticate(String urlStr,
String username,
String password,
HashMap<String,String> headers,
HashMap<String,String> params,
boolean followRedirects,
int timeout)
throws Exception
urlStr - username - password - headers - params - followRedirects - timeout -
Exception
public JbbHttpResponse post(String url,
HashMap<String,String> headers,
HashMap<String,String> params,
boolean followRedirects,
int timeout)
throws Exception
url - headers - params - followRedirects - timeout -
Exception
public JbbHttpResponse postXml(String url,
HashMap<String,String> headers,
String serializedXmlDocument,
boolean followRedirects,
int timeout)
throws Exception
url - headers - serializedXmlDocument - followRedirects - timeout -
Exception
public JbbHttpResponse postXml(String url,
HashMap<String,String> headers,
String serializedXmlDocument,
boolean followRedirects,
int timeout,
String postEncoding)
throws Exception
url - headers - serializedXmlDocument - followRedirects - timeout - postEncoding - the encoding to use for the serializedXmlDocument in the POST body
Exception
public JbbHttpResponse postFile(String url,
HashMap<String,String> headers,
String fileName,
boolean followRedirects,
int timeout)
throws Exception
url - headers - fileName - followRedirects - timeout -
Exception
public JbbHttpResponse multipartRequest(String url,
HashMap<String,String> headers,
HashMap<String,String> params,
File[] files,
boolean followRedirects,
int timeout)
throws Exception
url - headers - params - files - followRedirects - timeout -
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||