|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.io.RedirectHttpConnection
de.enough.polish.io.PostRedirectHttpConnection
public class PostRedirectHttpConnection
Provides a HttpConnection that supports HTTP redirects and allows easy creation of HTTP POST requests. This
class is compatible to javax.microedition.io.HttpConnection.
When connecting to an URL and a HTTP redirect is return this class follows
the redirect and uses the following HTTP connection. This works over multiple
levels. By default five redirects are supported. The number of supported
redirects can be tuned by setting the preprocessing variable
polish.Browser.MaxRedirects to some integer value.
You can specify a timeout with the PostRedirectHttpConnection( String url, int timeout) or PostRedirectHttpConnection( String url, Hashmap requestProperties, int timeout) constructor. On
MIDP and BlackBerry devices this will result in an additional thread being launched that waits for the specific time and then closes the connection
in case it has so far not succeeded.
HttpRedirectConnection| Field Summary |
|---|
| Constructor Summary | |
|---|---|
PostRedirectHttpConnection(String url)
Creates a new http connection that understands redirects. |
|
PostRedirectHttpConnection(String url,
HashMap requestProperties)
Creates a new http connection that understands redirects. |
|
PostRedirectHttpConnection(String url,
HashMap requestProperties,
int timeout)
Creates a new http connection that understands redirects. |
|
PostRedirectHttpConnection(String url,
int timeout)
Creates a new http connection that understands redirects. |
|
| Method Summary | |
|---|---|
void |
addPostParameter(String name,
String value)
Adds a parameter for this post request |
protected void |
ensureConnectionCreated()
Makes sure that the http connect got created. |
| Methods inherited from class de.enough.polish.io.RedirectHttpConnection |
|---|
close, getDate, getEncoding, getExpiration, getFile, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHost, getLastModified, getLength, getPort, getProtocol, getQuery, getRef, getRequestMethod, getRequestProperty, getResponseCode, getResponseMessage, getType, getURL, openDataInputStream, openDataOutputStream, openInputStream, openOutputStream, setLimitContentLengthParams, setRequestMethod, setRequestProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PostRedirectHttpConnection(String url)
throws IOException
url - the url to connect to
IOException - when Connector.open() fails
public PostRedirectHttpConnection(String url,
int timeout)
throws IOException
url - the url to connect to
IOException - when Connector.open() fails
public PostRedirectHttpConnection(String url,
HashMap requestProperties)
throws IOException
url - the url to connect torequestProperties - the request properties to be set for each http request
IOException - when Connector.open() fails
public PostRedirectHttpConnection(String url,
HashMap requestProperties,
int timeout)
throws IOException
url - the url to connect torequestProperties - the request properties to be set for each http request
IOException - when Connector.open() fails| Method Detail |
|---|
public void addPostParameter(String name,
String value)
name - the name of the parametervalue - the value
protected void ensureConnectionCreated()
throws IOException
RedirectHttpConnection
ensureConnectionCreated in class RedirectHttpConnectionIOException - when the connection failed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||