com.google.gdata.client.authn.oauth
Class OAuthHttpClient
java.lang.Object
com.google.gdata.client.authn.oauth.OAuthHttpClient
public class OAuthHttpClient
- extends java.lang.Object
A simple client for making http requests and returning the response body.
Uses HttpURLConnection
to make http requests.
Method Summary |
java.lang.String |
getResponse(java.net.URL url)
Makes an http request to the input URL, and returns the response body as a
string. |
java.lang.String |
getResponse(java.net.URL url,
java.util.Map<java.lang.String,java.lang.String> headers)
Makes an http request to the input URL, and returns the response body as a
string. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OAuthHttpClient
public OAuthHttpClient()
getResponse
public java.lang.String getResponse(java.net.URL url)
throws OAuthException
- Makes an http request to the input URL, and returns the response body as a
string.
- Parameters:
url
- the url to make the request to
- Returns:
- the response body of the request
- Throws:
OAuthException
- if there was an error making the request
getResponse
public java.lang.String getResponse(java.net.URL url,
java.util.Map<java.lang.String,java.lang.String> headers)
throws OAuthException
- Makes an http request to the input URL, and returns the response body as a
string.
- Parameters:
url
- the url to make the request toheaders
- any headers to add to the request
- Returns:
- the response body of the request
- Throws:
OAuthException
- if there was an error making the request