Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8087695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:51:44+00:00 2026-06-05T18:51:44+00:00

xml is not encoding proper – any help List<NameValuePair> formparams = new ArrayList<NameValuePair>(); formparams.add(new

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:51:48+00:00Added an answer on June 5, 2026 at 6:51 pm

    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:

    StringBuilder sb = new StringBuilder();
    Iterator<NameValuePair> i = formparams.iterator();
    while( i.hasNext() )
    {
        sb.append( i.next().toString() );
        if( i.hasNext() )
            sb.append( "&" );
    }
    

    and if you still need an HttpEntity that honors that output you could try using StringEntity with something like:

    HttpEntity entity = new StringEntity( sb.toString() );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a feeling this XML is not valid, can someone please explain why?
I have a C# class method that return a xml document not file. How
Hey i am unable to figure out why this xml is not being generated
With glassfish, my persistence.xml is not loaded. my.ear META-INF/persistence.xml lib/entities.jar <!-- no persistence.xml here
I'm not a big fan of XML files. Therefore I'm wondering if there is
I have a given XML document (structure can not be changed) and want to
My XML Feed looks like this http://tinyurl.com/6wc6fel Not sure how to read the data
this is my xml file,i do not known how to retrieve value from xml
Below roundtrip produces invaild xml as the result is not escaped correctly, i.e. the
Im not able to load the page with circlepageindicator. This is the xml <FrameLayout

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.