I'm adding my answer here because I can see there is some confusion among the other answers.
First of all, HashMap<K,V> is an implementation of the Map<K,V> interface, while the List<E> is just an interface, which needs to be implemented. ArrayList<E> is such an implementation.
A Map is used when you want to associate certain keys, with certain values. For example, it would make sense for a generic JSON parser to store the JSON object in a HashMap. A List, on the other hand, is used when you want to have an ordered collection of items.
Another thing I'd like to clear up, is that, contrary to what @KarlRichter mentions, an implementation of List, if done correctly, would access an element in O(1), and not in O(n). He seems to have confused the List with a LinkedList. A HashMap, would typically add the overhead of the hashing, so it could be just a little bit slower than List (in most cases unnoticeable), but still it would technically remain O(1).
However, a List serves a different purpose than a Map, so the comparison is still off the point.
In your case, you cannot replace List<NameValuePair> with HashMap<String,String>, because, as shown here, URLEncodedFormEntity only accepts List<? extends NameValuePair> or Iterable<? extends NameValuePair> in all the available constructors.
If you must use a HashMap<String,String>, you could do some kind of conversion, like the following:
public List<NameValuePair> hashMapToNameValuePairList(HashMap<String,String> map) {
List<NameValuePair> list = new ArrayList<NameValuePair>();
for (Map.Entry<String, String> entry : map.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
list.add(new BasicNameValuePair(key, value));
}
return list;
}
So, then, you create your list from the HashMap like below:
List<NameValuePair> list = hashMapToNameValuePairList(yourHashMap);