com.yahoo.rest
Class RestClient

java.lang.Object
  extended by 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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.