String params = getSortedAndEncodedParams(request);
return String.format(AMPERSAND_SEPARATED_STRING, verb, url, params);
}
private String getSortedAndEncodedParams(OAuthRequest request) {
HttpParameters params = new HttpParametersImpl();
params.addAll(request.getQueryStringParams());
params.addAll(request.getBodyParams());
params.addAll(new HttpParametersImpl(request.getOauthParameters()));
return params.asOauthBaseString();
}