I'm trying to make something the following server POST request using MultipartEntity:
parameters: {"parameter1"=>"parameter1", "parameter2"=>{"sub_parameter1"=>"sub_parameter1", "sub_parameter2"=>"sub_parameter2"}}
I am currently using something like:
multipartEntity.addPart("parameter1", new StringBody("parameter1"));
FormBodyPart parameter2 = new FormBodyPart("parameter2", new StringBody("")); // It wouldn't allow a null ContentBody
parameter2.addField("sub_parameter1", "sub_parameter1");
parameter2.addField("sub_parameter2", "sub_parameter2");
However, the sub fields do not carry though. I just get:
parameters: {"parameter1"=>"parameter1", "parameter2"=>""}
How do I create a nested structure in either the MultipartEntity or the FormBodyPart elements it contains?