In our project we are using the Multpart (http.entity.mime.MultipartEntity) to send data to the backend. Now, we have a new requirement which basically states the need to restrict the number of parts to two in a MultiPart request.
Normally, we added a new part for each parameter:
entity.addPart("parameterName1",new StringBody(parameterValue1));
entity.addPart("parameterName2",new StringBody(parameterValue2));
entity.addPart("parameterName3",new StringBody(parameterValue3));
entity.addPart("parameterName4",new StringBody(parameterValue4));
Now the requirement is like:
entity.addPart("parameterName1",new StringBody(parameterValue1+"|"+parameterValue2+"|"+parameterValue3));
entity.addPart("parameterName2",new StringBody(parameterValue2));
I would like to know if this is a good standard to follow and will this always restrict the number of parts to "two" in the Multipart call?