Is it possible to have a nested MultipartEntities or FormBodyPart in a multipart POST?

前端 未结 4 1933
孤街浪徒
孤街浪徒 2021-02-13 16:44

I\'m trying to make something the following server POST request using MultipartEntity:

parameters: {\"parameter1\"=>\"parameter1\", \"parameter2\"=>{\"sub_         


        
4条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-13 16:47

    Something like this:

    MultipartEntity reqEntity = new MultipartEntity();
    reqEntity.addPart("selectedGroup", new StringBody(group));
    reqEntity.addPart("selectedService", new StringBody(service.toString()));
    reqEntity.addPart("selectedTransformation", new StringBody(transformation.toString()));
    reqEntity.addPart("projectId", new StringBody(projectId.toString()));
    

    Check exapmle 8 of this link. Also exapmple 23 Example Site

    Hope this helps you with your problem.

提交回复
热议问题