/** * Creates an encoded query string from all the parameters in the specified * request. * * @param request * The request containing the parameters to encode. * * @return Null if no parameters were present, otherwise the encoded query * string for the parameters present in the specified request. */ public static String encodeParameters(SignableRequest<?> request) { final Map<String, List<String>> requestParams = request.getParameters(); if (requestParams.isEmpty()) return null; final List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); for (Entry<String, List<String>> entry : requestParams.entrySet()) { String parameterName = entry.getKey(); for (String value : entry.getValue()) { nameValuePairs .add(new BasicNameValuePair(parameterName, value)); } } return URLEncodedUtils.format(nameValuePairs, DEFAULT_ENCODING); }
/** * Creates an encoded query string from all the parameters in the specified * request. * * @param request * The request containing the parameters to encode. * * @return Null if no parameters were present, otherwise the encoded query * string for the parameters present in the specified request. */ public static String encodeParameters(SignableRequest<?> request) { final Map<String, List<String>> requestParams = request.getParameters(); if (requestParams.isEmpty()) return null; final List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); for (Entry<String, List<String>> entry : requestParams.entrySet()) { String parameterName = entry.getKey(); for (String value : entry.getValue()) { nameValuePairs .add(new BasicNameValuePair(parameterName, value)); } } return URLEncodedUtils.format(nameValuePairs, DEFAULT_ENCODING); }
/** * Creates an encoded query string from all the parameters in the specified * request. * * @param request * The request containing the parameters to encode. * * @return Null if no parameters were present, otherwise the encoded query * string for the parameters present in the specified request. */ public static String encodeParameters(SignableRequest<?> request) { final Map<String, List<String>> requestParams = request.getParameters(); if (requestParams.isEmpty()) return null; final List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); for (Entry<String, List<String>> entry : requestParams.entrySet()) { String parameterName = entry.getKey(); for (String value : entry.getValue()) { nameValuePairs .add(new BasicNameValuePair(parameterName, value)); } } return RxURLEncodedUtils.format(nameValuePairs, DEFAULT_CHARSET); }
/** * Creates an encoded query string from all the parameters in the specified * request. * * @param request * The request containing the parameters to encode. * * @return Null if no parameters were present, otherwise the encoded query * string for the parameters present in the specified request. */ public static String encodeParameters(SignableRequest<?> request) { final Map<String, List<String>> requestParams = request.getParameters(); if (requestParams.isEmpty()) return null; final List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); for (Entry<String, List<String>> entry : requestParams.entrySet()) { String parameterName = entry.getKey(); for (String value : entry.getValue()) { nameValuePairs .add(new BasicNameValuePair(parameterName, value)); } } return URLEncodedUtils.format(nameValuePairs, DEFAULT_ENCODING); }