// TODO: this is a little odd: we already encoded the values earlier, but using URLEncodedUtils.parse will decode the values,
// which we will encode again.
List<NameValuePair> httpGetParams = URLEncodedUtils.parse(request.getURI().getRawQuery(), Charsets.UTF_8);
List<Pair> javaParams = new ArrayList<Pair>(httpGetParams.size());
for (NameValuePair params : httpGetParams) {
Pair tuple = new Pair(UrlCodec.encode(params.getName()), UrlCodec.encode(params.getValue()));
javaParams.add(tuple);
}
if (postParams != null) {
List<NameValuePair> httpPostParams = URLEncodedUtils.parse(postParams, Charsets.UTF_8);
for (NameValuePair params : httpPostParams) {
Pair tuple = new Pair(UrlCodec.encode(params.getName()), UrlCodec.encode(params.getValue()));
javaParams.add(tuple);
}
}
long timestampSecs = generateTimestamp();