public class CommonsHttpOAuthProvider extends AbstractOAuthProvider
HttpClient 4.x HTTP
implementation to fetch OAuth tokens from a service provider. Android users
should use this provider implementation in favor of the default one, since
the latter is known to cause problems with Android's Apache Harmony
underpinnings.| Constructor and Description |
|---|
CommonsHttpOAuthProvider(String requestTokenEndpointUrl,
String accessTokenEndpointUrl,
String authorizationWebsiteUrl) |
CommonsHttpOAuthProvider(String requestTokenEndpointUrl,
String accessTokenEndpointUrl,
String authorizationWebsiteUrl,
org.apache.http.client.HttpClient httpClient) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeConnection(HttpRequest request,
HttpResponse response)
Called when the connection is being finalized after receiving the
response.
|
protected HttpRequest |
createRequest(String endpointUrl)
Overrride this method if you want to customize the logic for building a
request object for the given endpoint URL.
|
protected HttpResponse |
sendRequest(HttpRequest request)
Override this method if you want to customize the logic for how the given
request is sent to the server.
|
void |
setHttpClient(org.apache.http.client.HttpClient httpClient) |
getAccessTokenEndpointUrl, getAuthorizationWebsiteUrl, getRequestHeaders, getRequestTokenEndpointUrl, getResponseParameter, getResponseParameters, handleUnexpectedResponse, isOAuth10a, removeListener, retrieveAccessToken, retrieveRequestToken, retrieveToken, setListener, setOAuth10a, setRequestHeader, setResponseParameterspublic CommonsHttpOAuthProvider(String requestTokenEndpointUrl, String accessTokenEndpointUrl, String authorizationWebsiteUrl)
public void setHttpClient(org.apache.http.client.HttpClient httpClient)
protected HttpRequest createRequest(String endpointUrl) throws Exception
AbstractOAuthProvidercreateRequest in class AbstractOAuthProviderendpointUrl - the URL to which the request will goException - if something breaksprotected HttpResponse sendRequest(HttpRequest request) throws Exception
AbstractOAuthProvidersendRequest in class AbstractOAuthProviderrequest - the request to sendException - if something breaksprotected void closeConnection(HttpRequest request, HttpResponse response) throws Exception
AbstractOAuthProvidercloseConnection in class AbstractOAuthProviderrequest - the request that has been sentresponse - the response that has been receivedException - if something breaksCopyright © 2025. All rights reserved.