This class can also be used to request access to protected resources, in some cases. But not in all cases. For example, this class can't handle arbitrary HTTP headers.
Methods of this class return a response as an OAuthMessage, from which you can get a body or parameters but not both. Calling a getParameter method will read and close the body (like readBodyAsString), so you can't read it later. If you read or close the body first, then getParameter can't read it. The response headers should tell you whether the response contains encoded parameters, that is whether you should call getParameter or not.
Methods of this class don't follow redirects. When they receive a redirect response, they throw an OAuthProblemException, with properties HttpResponseMessage.STATUS_CODE = the redirect code HttpResponseMessage.LOCATION = the redirect URL. Such a redirect can't be handled at the HTTP level, if the second request must carry another OAuth signature (with different parameters). For example, Google's Service Provider routinely redirects requests for access to protected resources, and requires the redirected request to be signed. @author John Kristian
|
|
|
|
|
|