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
Post a Comment