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

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -