Discussion:
[jboss-user] [jBPM] - JAVA HttpPost enctype = “multiform/data”
Siva NB
2013-01-16 09:46:35 UTC
Permalink
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]
Loading...