I'm trying to send a POST Request to a Webserver. The Call is tested in JMeter.
Now I've got the following code:
//HEADER SECTION
post.setHeader("Connection","keep-alive");
post.setHeader("Host", "http://sv2XXX.XXX.XXX.XXX.com:8080");
post.setHeader("Content-Type", "text/plain");
//BODY SECTION
ArrayList<NameValuePair> urlParameters = new ArrayList<NameValuePair>();
urlParameters.add(new BasicNameValuePair("","<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:api=\"http://api.XXX.XXX.XXX.com/\">" +
"<soap:Header>" +
"<api:userid>USER1</api:userid>" +
"</soap:Header>" +
"<soap:Body>" +
"<api:executeAbout>" +
"<About/>" +
"</api:executeAbout>" +
"</soap:Body>" +
"</soap:Envelope>"));
post.setEntity(new UrlEncodedFormEntity(urlParameters));
Some how this results in a "400 Bad Request" Error. In my opinion this is caused by the empty name in the parameters declaration. But I don't know how to call it. Any ideas?