|
||||||||
| 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 standard version is OAuthSignpostClient.
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 is setup to do authentication when contacting the Twitter 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. |
void |
setTimeout(int millisecs)
Set the timeout for a single get/post request. |
| Method Detail |
|---|
boolean canAuthenticate()
TwitterAccount.verifyCredentials() if you need to check a
login.
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 errorsvoid setTimeout(int millisecs)
millisecs -
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||