|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.util.Helper<T>
com.noelios.restlet.ConnectorHelper<Client>
com.noelios.restlet.ClientHelper
com.noelios.restlet.http.HttpClientHelper
com.noelios.restlet.ext.net.HttpClientHelper
public class HttpClientHelper
HTTP client connector using the HttpUrlConnectionCall. Here is the list of parameters that are supported:
Parameter name | Value type | Default value | Description |
---|---|---|---|
allowUserInteraction | boolean | false | If true, this URL is being examined in a context in which it makes sense to allow user interactions such as popping up an authentication dialog. |
chunkLength | int | 0 (uses HttpURLConnection's default) | The chunk-length when using chunked encoding streaming mode for response entities. A value of -1 means chunked encoding is disabled for response entities. |
connectTimeout | int | 0 | Sets a specified timeout value, in milliseconds, to be used when opening a communications link to the resource referenced. 0 means infinite timeout. This parameter is deprecated and should be replaced by the connectTimeout attribute defined by the client. |
followRedirects | boolean | false | If true, the protocol will automatically follow redirects. If false, the protocol will not automatically follow redirects. |
readTimeout | int | 0 | Sets the read timeout to a specified timeout, in milliseconds. A timeout of zero is interpreted as an infinite timeout. |
useCaches | boolean | false | If true, the protocol is allowed to use caching whenever it can. |
getHostnameVerifier()
method for details.
Note that by default, the HttpURLConnection
class as implemented by
Sun will retry a request if an IO exception is caught, for example due to a
connection reset by the server. This can be annoying, especially because the
HTTP semantics of non idempotent methods like POST can be broken, but also
because the new request won't include an entity. There is one way to disable
this behavior for POST requests only by setting the system property
"sun.net.http.retryPost" to "false".
Client.getConnectTimeout()
,
Networking
FeaturesConstructor Summary | |
---|---|
HttpClientHelper(Client client)
Constructor. |
Method Summary | |
---|---|
HttpClientCall |
create(Request request)
Creates a low-level HTTP client call from a high-level uniform call. |
int |
getChunkLength()
Returns the chunk-length when using chunked encoding streaming mode for response entities. |
int |
getConnectTimeout()
Returns the timeout value, in milliseconds, to be used when opening a communications link to the resource referenced. |
javax.net.ssl.HostnameVerifier |
getHostnameVerifier()
Returns the hostname verifier by looking up the "hostnameVerifier" attribute of the client's context. |
int |
getReadTimeout()
Returns the read timeout value. |
boolean |
isAllowUserInteraction()
Indicates if this URL is being examined in a context in which it makes sense to allow user interactions such as popping up an authentication dialog. |
boolean |
isFollowRedirects()
Indicates if the protocol will automatically follow redirects. |
boolean |
isUseCaches()
Indicates if the protocol is allowed to use caching whenever it can. |
void |
start()
|
void |
stop()
|
Methods inherited from class com.noelios.restlet.http.HttpClientHelper |
---|
getConverter, handle, setConverter |
Methods inherited from class com.noelios.restlet.ConnectorHelper |
---|
getProtocols, update |
Methods inherited from class org.restlet.util.Helper |
---|
getAttributes, getContext, getHelped, getHelpedParameters, getLogger, setHelped |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpClientHelper(Client client)
client
- The client to help.Method Detail |
---|
public HttpClientCall create(Request request)
create
in class HttpClientHelper
request
- The high-level request.
public int getChunkLength()
public int getConnectTimeout()
getConnectTimeout
in class ClientHelper
public javax.net.ssl.HostnameVerifier getHostnameVerifier()
public int getReadTimeout()
public boolean isAllowUserInteraction()
public boolean isFollowRedirects()
public boolean isUseCaches()
public void start() throws java.lang.Exception
start
in class ConnectorHelper<Client>
java.lang.Exception
public void stop() throws java.lang.Exception
stop
in class ConnectorHelper<Client>
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |