Replace UrlEncodedFormEntity with stringEntity Android -


i want ask question setheader in android , trying modify setentity :

httppost.setentity(new urlencodedformentity(params, "utf-8")); 

to :

stringentity stringentity = new stringentity("name=value1&price=value2$=&description=value3", "utf-8");  httppost.setentity(stringentity); 

in sever , _post can't receive information util add header httppost :

httppost.setheader("content-type","application/x-www-form-urlencoded;charset=utf-8"); 

i same httpurlconnection , change "name=value1&price=value2&description=value3" bytes write in outputstream , _post can receive information . why have setheader httppost?


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -