Code example for HttpRequestBase

Methods: getURI

0
    } 
 
    public FoursquareType doHttpRequest(HttpRequestBase httpRequest,
            Parser<? extends FoursquareType> parser) throws FoursquareCredentialsException,
            FoursquareParseException, FoursquareException, IOException { 
        if(DEBUG)Log.d(TAG, "doHttpRequest: " + httpRequest.getURI());
            try { 
                 
            	/* 
            	// TODO: append oauth_token for every request!!! 
            	if (httpRequest.getMethod().equalsIgnoreCase("GET")) { 
                	HttpParams httpParams = httpRequest.getParams(); 
                	httpParams.setParameter("oauth_token", getOAuthToken()); 
                	httpRequest.setParams( httpParams ); 
            	} 
            	else if (httpRequest.getMethod().equalsIgnoreCase("POST")) { 
            	} 
            	*/ 
            	 
            	 
            	if(DEBUG)Log.d(TAG, "Signing request: " + httpRequest.getURI());
            	if(DEBUG)Log.d(TAG, "Consumer: " + mConsumer.getConsumerKey() + ", "
                        + mConsumer.getConsumerSecret());
            	if(DEBUG)Log.d(TAG, "Token: " + mConsumer.getToken() + "|secret:" + mConsumer.getTokenSecret());
                mConsumer.sign(httpRequest);
                 
            } catch (OAuthMessageSignerException e) {
            	if(DEBUG)Log.d(TAG, "OAuthMessageSignerException", e);
                throw new RuntimeException(e);
            } catch (OAuthExpectationFailedException e) {
            	if(DEBUG)Log.d(TAG, "OAuthExpectationFailedException", e);
                throw new RuntimeException(e);
            } 
        return executeHttpRequest(httpRequest, parser);
    } 
 
    public String doHttpPost(String url, NameValuePair... nameValuePairs) throws FoursquareError,
            FoursquareParseException, IOException, FoursquareCredentialsException { 
        throw new RuntimeException("Haven't written this method yet.");