|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public static interface Twitter.IHttpClient
Interface for an http client - e.g. allows for OAuth to be used instead. The default version is
URLConnectionHttpClient.
If creating your own version, please provide support for throwing the right subclass of TwitterException - see
URLConnectionHttpClient.processError(java.net.HttpURLConnection) for example code.
| Method Summary | |
|---|---|
boolean |
canAuthenticate()
Whether this client can authenticate to the server. |
java.lang.String |
getPage(java.lang.String uri,
java.util.Map<java.lang.String,java.lang.String> vars,
boolean authenticate)
Send an HTTP GET request and return the response body. |
java.lang.String |
post(java.lang.String uri,
java.util.Map<java.lang.String,java.lang.String> vars,
boolean authenticate)
Send an HTTP POST request and return the response body. |
| Method Detail |
|---|
boolean canAuthenticate()
java.lang.String getPage(java.lang.String uri,
java.util.Map<java.lang.String,java.lang.String> vars,
boolean authenticate)
throws TwitterException
uri - The uri to fetchvars - get arguments to add to the uriauthenticate - If true, use authentication. The authentication method used depends on the implementation (basic-auth,
OAuth). It is an error to use true if no authentication details have been set.
TwitterException - for a variety of reasons
TwitterException.E404 - for resource-does-not-exist errors
java.lang.String post(java.lang.String uri,
java.util.Map<java.lang.String,java.lang.String> vars,
boolean authenticate)
throws TwitterException
uri - The uri to post to.vars - The form variables to send. These are URL encoded before sending.authenticate - If true, send user authentication
TwitterException - for a variety of reasons
TwitterException.E404 - for resource-does-not-exist errors
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||