xml is not encoding proper – any help
List<NameValuePair> formparams = new ArrayList<NameValuePair>();
formparams.add(new BasicNameValuePair("VENDOR", "pradeep"));
formparams.add(new BasicNameValuePair("REQTYPE", "ExternalSystem"));
formparams.add(new BasicNameValuePair("DATA", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams, "UTF-8");
my out is VENDOR=pradeep&REQTYPE=ExternalSystem&DATA=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E
but i expected this out
VENDOR=D-B165&REQTYPE=EXRCTRFREQ&DATA=<?xml version=\"1.0\" encoding=\"UTF-8\"?>
any one how to do above
Thanks, Pradeep
It looks like the output from your UrlEncodedFormEntity() call is correct – it has URL encoded all of the NameValuePairs in formparms ala Percent-encoding.
You don’t mention the use case for your expected output, but this will do what you want by simply concatenating the NameValuePairs w/o the encoding:
and if you still need an HttpEntity that honors that output you could try using StringEntity with something like: