[jboss-user] [jBPM] - JAVA HttpPost enctype = “multiform/data”

Siva NB do-not-reply at jboss.com
Wed Jan 16 04:46:35 EST 2013


Siva NB [https://community.jboss.org/people/nbsiva90] created the discussion

"JAVA HttpPost enctype = “multiform/data”"

To view the discussion, visit: https://community.jboss.org/message/792266#792266

--------------------------------------------------------------
Hi,

I'm trying to make my own jbpm console client.

i'm facing a blocking issue while create a new instance of a process.

For creating a new instance, the form structure is 

<form action="localhost/xyz.aspx" method = "post" enctype="multipart/form-data">
     <input type="text" name="name">
     <input type="text" name="age">
     <input type="text" name="submit">
</form>

So inorder to create a submit request,
 List<NameValuePair> formparams1 = new ArrayList<NameValuePair>();
 formparams1.add(new BasicNameValuePair("name","john"));
 formparams1.add(new BasicNameValuePair("age", "10"));
 UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams1);
 httppost.setEntity(entity);
  httpClient.execute(httppost);

Even this fails.

 So tried another approach,
 MultipartEntity entity = new MultipartEntity();
entity.addPart("name",new StringBody("john",Charset.forName("UTF-8")));
entity.addPart("age", new StringBody("10",Charset.forName("UTF-8")));
httppost.setEntity(entity);
httpClient.execute(httppost);

Note: followed the pattern in  https://community.jboss.org/thread/203492?start=15&tstart=0 https://community.jboss.org/thread/203492?start=15&tstart=0

Can anyone pls help me 

TIA
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/792266#792266]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130116/bd667204/attachment-0001.html 


More information about the jboss-user mailing list