I'm presently programming a credit card applicatoin that must send an http Publish request to some server. The request must contain particular parameters which within an equivalent GET request could be encoded within the url. However, your body from the http Request must be properly formatted xml that the server will parse. So, when i comprehend it, the file must be put into the request like so:

httpClient = new DefaultHttpClient();
    HttpPost post = new HttpPost("url...");
    if (httpContent != null){
        InputStreamEntity httpStream = new InputStreamEntity(httpContent,-1);
        httpStream.setContentType("text/xml");
        httpStream.setChunked(true);

        post.setEntity(httpStream);
    }

And parameters have to be added like a title-value pair such as this:

List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);  
nameValuePairs.add(new BasicNameValuePair("userid", "12312"));  
nameValuePairs.add(new BasicNameValuePair("sessionid", "234"));  
post.setEntity(new UrlEncodedFormEntity(nameValuePairs));

now, I think the httpPost are only able to have one entity set unless of course I'm misunderstanding it. So, How do i set the parameters but still support the xml because the http body?

Thanks ahead of time!

Avoid using the UrlEncodedFormEntity - this really is still an application entity, and will not provide you with the "GET request" equivalent that you are searching for.

Rather, just append your parameters onto the URL passed towards the HttpPost constructor:

url...?userid=12312&sessionid=234