php - I get duplicate error when I post same string using NameValuePair
I am posting strings to server using Http post, when I post a single string using NameValuePair it works perfectly but when I repeat the same strings I get error of duplicate strings, and does not upload to server. I need any that can accept duplicate strings and its equivalent JSONParser.
List<NameValuePair>params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("message", "me"));
This is the error I get when I try to post same string again:
Error parsing data org.json.JSONException: Value Duplicate of type java.lang.String cannot be converted to JSONObject
Answer
Solution:
The JSON standard doesn't allow to have two entries with the same name. May u want to use an array instead?
Edit:
Think what you want to do is something like that:
So its
instead of