com.yahoo.rest
Class RestClient
java.lang.Object
com.yahoo.rest.RestClient
public class RestClient
- extends Object
Simple REST client.
TODO: Handle error codes (http://developer.yahoo.net/documentation/errors.html).
TODO: Parse error XML when error occurs.
TODO: Add request/response logging.
- Author:
- Ryan Kennedy
|
Method Summary |
static InputStream |
call(String serviceUrl,
Map parameters)
Calls the given REST resource with the given parameters. |
call
public static InputStream call(String serviceUrl,
Map parameters)
throws IOException,
RestException
- Calls the given REST resource with the given parameters.
- Parameters:
serviceUrl - The URL of the REST resource to call.parameters - The parameters to pass to the call.
- Returns:
- The InputStream to the content returned by the resource.
- Throws:
IOException - Thrown if a networking issue occurs.
RestException - Thrown if the call fails. Could be caused by the service or the client. Check the error message for more information.