src/com/mlhsoftware/commandline/RESTAPI/RestClient.java
public JSONObject send( Hashtable data ) throws RestException
  {
    try
    {
      if ( sessionKey != null )
      {
        data.put( "session_key", sessionKey );
      }

      data.put( "api_key", applicationKey );
      data.put( "call_id", String.valueOf( System.currentTimeMillis() ) );
      data.put( "v", "1.0" );
      data.put( "format", "JSON" );
      data.put( "sig", getSignature( data, secretKey ) );

      StringBuffer response = httpClient.doPost( url, data );

      if ( response.length() == 0 )
      {
        throw new RestException( "Empty response" );
      }

      return new JSONObject( new JSONTokener( response.toString() ) );
    }
    catch ( RestException e )
    {
      throw e;
    }
    catch ( Exception e )
    {
      throw new RestException( e.getMessage() );
    }
  }
/**
         * Send request to the REST server given data.
         * 
   * @param data
   *            the data to send.
   * @return response from the REST server as a JSON object.
   * @throws RestException
   *             when encounters any error.
         */
Send request to the REST server given data.

@param data
the data to send.
@return response from the REST server as a JSON object.
@throws RestException
when encounters any error.
Send request to the REST server given data . @param data the data to send . @return response from the REST server as a JSON object . @throws RestException when encounters any error .
public JSONObject send( Hashtable data ) throws RestException
  {
    try
    {
      if ( sessionKey != null )
      {
        data.put( "session_key", sessionKey );
      }
      data.put( "api_key", applicationKey );
      data.put( "call_id", String.valueOf( System.currentTimeMillis() ) );
      data.put( "v", "1.0" );
      data.put( "format", "JSON" );
      data.put( "sig", getSignature( data, secretKey ) );
      StringBuffer response = httpClient.doPost( url, data );
      if ( response.length() == 0 )
      {
        throw new RestException( "Empty response" );
      }
      return new JSONObject( new JSONTokener( response.toString() ) );
    }
    catch ( RestException e )
    {
      throw e;
    }
    catch ( Exception e )
    {
      throw new RestException( e.getMessage() );
    }
  }
public JSONObject send ( Hashtable data ) throws RestException { try { if ( sessionKey != null ) { data . put ( "session_key" , sessionKey ) ; } data . put ( "api_key" , applicationKey ) ; data . put ( "call_id" , String . valueOf ( System . currentTimeMillis ( ) ) ) ; data . put ( "v" , "1.0" ) ; data . put ( "format" , "JSON" ) ; data . put ( "sig" , getSignature ( data , secretKey ) ) ; StringBuffer response = httpClient . doPost ( url , data ) ; if ( response . length ( ) == 0 ) { throw new RestException ( "Empty response" ) ; } return new JSONObject ( new JSONTokener ( response . toString ( ) ) ) ; } catch ( RestException e ) { throw e ; } catch ( Exception e ) { throw new RestException ( e . getMessage ( ) ) ; } }
Send request to the REST server given data.
Send request to the REST server given data .