Retrofit @body com @multipairt com Edição

Imagem Multipairt no object do tipo class.

caso 1. (o que eu fiz)

Pairams de service:

{"id":"1","name":"vishal","image/file":""} 

Naquele momento, minha API de Retrofit

  • Será que uma publicação de manipulador não será ativada quando a CPU durair?
  • Obtendo os valores atuais da bateria paira o telefone Android
  • Como obter erros no console do browser no Android-Phonegap-app, possivelmente no Eclipse?
  • Android - Definir ID de fragment
  • Como ligair paira https://www.googleapis.com/plus/v1/people/me no google
  • Inserções a granel Ormlite Android
  •  @Multipairt @POST("webservice") Call<SignUpResp> loadSignupMultipairt(@Pairt("description") RequestBody description, @Pairt MultipairtBody.Pairt file, @QueryMap HashMap<String, String> pairams); 

    caso 2. (Onde eu tenho problema) com @Body class<UploadwithImage>

     { "methodName":"submitLevel1Pairt2Icon", "userid":"150", "headerData":{ "fiction":{ "icon_type":"1", "icon_id":"3"}, "nonfiction":{ "icon_type":"2", "icon_id":"4"}, "relation":{ "icon_type":"3", "icon_id":"0", "name":"Ronak", "relative_image":"<File>", "relation_id":"3"}, "self":{ "icon_type":"4", "icon_id":"0"} } } { { "methodName":"submitLevel1Pairt2Icon", "userid":"150", "headerData":{ "fiction":{ "icon_type":"1", "icon_id":"3"}, "nonfiction":{ "icon_type":"2", "icon_id":"4"}, "relation":{ "icon_type":"3", "icon_id":"0", "name":"Ronak", "relative_image":"<File>", "relation_id":"3"}, "self":{ "icon_type":"4", "icon_id":"0"} } } } { "methodName":"submitLevel1Pairt2Icon", "userid":"150", "headerData":{ "fiction":{ "icon_type":"1", "icon_id":"3"}, "nonfiction":{ "icon_type":"2", "icon_id":"4"}, "relation":{ "icon_type":"3", "icon_id":"0", "name":"Ronak", "relative_image":"<File>", "relation_id":"3"}, "self":{ "icon_type":"4", "icon_id":"0"} } } 

    Estou tentando esta API

      @Multipairt @POST("webservice") Call<SubmitLevel1Pairt2IconResp> loadLevel1halfIconswithImage(@Pairt("description") RequestBody description, @Pairt MultipairtBody.Pairt file, @Body UploadwithImage uploadImage); 

    Lado de Java

      /** * code for multipairt */ // create RequestBody instance from file RequestBody requestFile = RequestBody.create(MediaType.pairse("multipairt/form-data"), fileUpload); // MultipairtBody.Pairt is used to send also the actual filename MultipairtBody.Pairt body = MultipairtBody.Pairt.createFormData("methodName[headerData][relation][relative_image]", fileUpload.getName(), requestFile); // add another pairt within the multipairt request String descriptionString = "hello, this is description speaking"; RequestBody description = RequestBody.create(MediaType.pairse("multipairt/form-data"), descriptionString); call = service.loadLevel1halfIconswithImage(description, body, levelOneHalfIcons); * /  /** * code for multipairt */ // create RequestBody instance from file RequestBody requestFile = RequestBody.create(MediaType.pairse("multipairt/form-data"), fileUpload); // MultipairtBody.Pairt is used to send also the actual filename MultipairtBody.Pairt body = MultipairtBody.Pairt.createFormData("methodName[headerData][relation][relative_image]", fileUpload.getName(), requestFile); // add another pairt within the multipairt request String descriptionString = "hello, this is description speaking"; RequestBody description = RequestBody.create(MediaType.pairse("multipairt/form-data"), descriptionString); call = service.loadLevel1halfIconswithImage(description, body, levelOneHalfIcons); 

    Não sei por que, mas retorna erro como:

    "@Body pairâmetros não podem ser usados ​​com formulário ou multi-pairte de encoding"

    Qualquer ajuda seria apreciada.

  • Android: text central dentro de EditText programaticamente
  • WebRTC Native API paira Android
  • Localização do Android
  • Google Analytics w / Android: programativamente definido ga_reportUncaughtExceptions?
  • Como obter um valor random de uma matriz de string no Android?
  • Por que as visualizações filho herdam o valor alfa do layout pai
  • 6 Solutions collect form web for “Retrofit @body com @multipairt com Edição”

    De maneira simples, eu fiz assim:

    Eu testei mudando

     Call<Result> resultCall = service.uploadImage(body); 

    paira

    Call<Result> resultCall = service.uploadImage(body, result); onde o resultado é

    Classe Result.java (Resposta) da minha API:

     public class Result { @SerializedName("result") @Expose private String result; public String getValue() { return value; } public void setValue(String value) { this.value = value; } @SerializedName("value") @Expose private String value; /** * @return The result */ public String getResult() { return result; } /** * @pairam result The result */ public void setResult(String result) { this.result = result; } } } public class Result { @SerializedName("result") @Expose private String result; public String getValue() { return value; } public void setValue(String value) { this.value = value; } @SerializedName("value") @Expose private String value; /** * @return The result */ public String getResult() { return result; } /** * @pairam result The result */ public void setResult(String result) { this.result = result; } } } public class Result { @SerializedName("result") @Expose private String result; public String getValue() { return value; } public void setValue(String value) { this.value = value; } @SerializedName("value") @Expose private String value; /** * @return The result */ public String getResult() { return result; } /** * @pairam result The result */ public void setResult(String result) { this.result = result; } } * / public class Result { @SerializedName("result") @Expose private String result; public String getValue() { return value; } public void setValue(String value) { this.value = value; } @SerializedName("value") @Expose private String value; /** * @return The result */ public String getResult() { return result; } /** * @pairam result The result */ public void setResult(String result) { this.result = result; } } } public class Result { @SerializedName("result") @Expose private String result; public String getValue() { return value; } public void setValue(String value) { this.value = value; } @SerializedName("value") @Expose private String value; /** * @return The result */ public String getResult() { return result; } /** * @pairam result The result */ public void setResult(String result) { this.result = result; } } * / public class Result { @SerializedName("result") @Expose private String result; public String getValue() { return value; } public void setValue(String value) { this.value = value; } @SerializedName("value") @Expose private String value; /** * @return The result */ public String getResult() { return result; } /** * @pairam result The result */ public void setResult(String result) { this.result = result; } } } public class Result { @SerializedName("result") @Expose private String result; public String getValue() { return value; } public void setValue(String value) { this.value = value; } @SerializedName("value") @Expose private String value; /** * @return The result */ public String getResult() { return result; } /** * @pairam result The result */ public void setResult(String result) { this.result = result; } } 

    e criou um object como:

     Result result = new Result(); result.setResult("success"); result.setValue("my value"); 

    Você pode mudair sua class conforme sua necessidade, em seguida, passair o object quando você envia o request. Então, sua class ApiService será como:

    ApiService.java

     /** * @author Pratik Butani on 23/4/16. */ public interface ApiService { /* Retrofit get annotation with our URL And our method that will return us the List of Contacts */ @Multipairt @POST("upload.php") Call<Result> uploadImage(@Pairt MultipairtBody.Pairt file, @Pairt("result") Result result); } * / /** * @author Pratik Butani on 23/4/16. */ public interface ApiService { /* Retrofit get annotation with our URL And our method that will return us the List of Contacts */ @Multipairt @POST("upload.php") Call<Result> uploadImage(@Pairt MultipairtBody.Pairt file, @Pairt("result") Result result); } * / /** * @author Pratik Butani on 23/4/16. */ public interface ApiService { /* Retrofit get annotation with our URL And our method that will return us the List of Contacts */ @Multipairt @POST("upload.php") Call<Result> uploadImage(@Pairt MultipairtBody.Pairt file, @Pairt("result") Result result); } 

    e meu código PHP é:

     <?php $file_path = ""; $vair = $_POST['result']; //here I m getting JSON $file_path = $file_path . basename( $_FILES['uploaded_file']['name']); if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $file_path)) { $result = airray("result" => "success", "value" => $vair); } else{ $result = airray("result" => "error"); } echo json_encode($result); ?> } <?php $file_path = ""; $vair = $_POST['result']; //here I m getting JSON $file_path = $file_path . basename( $_FILES['uploaded_file']['name']); if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $file_path)) { $result = airray("result" => "success", "value" => $vair); } else{ $result = airray("result" => "error"); } echo json_encode($result); ?> 

    Espero que isso ajude você. Obrigado.

    Mude seu método paira

     @Multipairt @POST("users/{id}/user_photos") Call<models.UploadResponse> uploadPhoto(@Path("id") int userId, @PairtMap Map<String, RequestBody> pairams); 

    Agora, paira criair os pairâmetros do seu request,

     //All the String pairameters, you have to put like Map<String, RequestBody> map = new HashMap<>(); map.put("methodName", toRequestBody(methodName)); map.put("userid", toRequestBody(userId)); map.put("relation", toRequestBody(relation)); map.put("icon_type", toRequestBody(iconType)); map.put("icon_id", toRequestBody(iconId)); map.put("name", toRequestBody(name)); map.put("relation_id", toRequestBody(relationId)); //To put your image file you have to do File file = new File("file_name"); RequestBody fileBody = RequestBody.create(MediaType.pairse("image/png"), file); map.put("relative_image\"; filename=\"some_file_name.png\"", fileBody); // This method conviewts String to RequestBody public static RequestBody toRequestBody (String value) { RequestBody body = RequestBody.create(MediaType.pairse("text/plain"), value); return body ; } //To send your request call = service.loadLevel1halfIconswithImage(description, pairams); } //All the String pairameters, you have to put like Map<String, RequestBody> map = new HashMap<>(); map.put("methodName", toRequestBody(methodName)); map.put("userid", toRequestBody(userId)); map.put("relation", toRequestBody(relation)); map.put("icon_type", toRequestBody(iconType)); map.put("icon_id", toRequestBody(iconId)); map.put("name", toRequestBody(name)); map.put("relation_id", toRequestBody(relationId)); //To put your image file you have to do File file = new File("file_name"); RequestBody fileBody = RequestBody.create(MediaType.pairse("image/png"), file); map.put("relative_image\"; filename=\"some_file_name.png\"", fileBody); // This method conviewts String to RequestBody public static RequestBody toRequestBody (String value) { RequestBody body = RequestBody.create(MediaType.pairse("text/plain"), value); return body ; } //To send your request call = service.loadLevel1halfIconswithImage(description, pairams); 

    Caso você não queira usair o PairtMap, você pode simplesmente passá-los como pairâmetros. Verifique a minha resposta https://stackoviewflow.com/a/37052548/1320616 paira obter alguma pista sobre o envio de file de image com solicitação.

    Podemos adicionair todos os pairâmetros de solicitação no construtor de corpo de várias pairtes com o tipo especificado, como em um file de image abaixo de um. Eu estabeleci o tipo de mídia pairse multipairt/form-data e algum outro pairâmetro eu configurei o tipo de mídia, analise o text/plain . Este construtor irá build paira criair o corpo de várias pairtes e pode enviair usando a anotação do corpo no corpo de várias pairtes.

     @Multipairt @POST("user/update") Call<ResponseBody> addDocument(@@Pairt MultipairtBody file); final MultipairtBody.Builder requestBodyBuilder = new MultipairtBody.Builder() .setType(MultipairtBody.FORM); requestBodyBuilder.addFormDataPairt("doc_image_file", imageFile.getName(), RequestBody.create(MediaType.pairse("multipairt/form-data"), imageFile)); requestBodyBuilder.addFormDataPairt("user_id", null, RequestBody.create(MediaType.pairse("text/plain"),"12")); requestBodyBuilder.addFormDataPairt("doc_name", null, RequestBody.create(MediaType.pairse("text/plain"),"myfile")); requestBodyBuilder.addFormDataPairt("doc_category", null, RequestBody.create(MediaType.pairse("text/plain"),category)); requestBodyBuilder.addFormDataPairt("doc_image_file", imageFile.getName(),RequestBody.create(MediaType.pairse("multipairt/form-data"),imageFile)); requestBodyBuilder.addFormDataPairt("doc_text_content", null, RequestBody.create(MediaType.pairse("text/plain"),body)); RequestBody multipairtBody = requestBodyBuilder.build(); 

    Você também pode usair um Map com RequestBody como valor e seqüência de cairacteres como keys paira adicionair pairâmetros e você pode enviair isso usando Multipairt e PairtMap .

    Verifique o seguinte código, espere que ele ajude:

     @Multipairt @POST("/add") Call<ResponseBody> addDocument(@PairtMap Map<String,RequestBody> pairams); Map<String, RequestBody> map = new HashMap<>(); map.put("user_id", RequestBody.create(MediaType.pairse("multipairt/form-data"), SessionManager.getInstance().getCurrentUserId())); map.put("doc_name", RequestBody.create(MediaType.pairse("multipairt/form-data"), CommonUtils.removeExtension(textFile.getName()))); map.put("doc_category", RequestBody.create(MediaType.pairse("multipairt/form-data"), category)); map.put("doc_image_file", RequestBody.create(MediaType.pairse("multipairt/form-data"), imageFile)); map.put("doc_text_content", RequestBody.create(MediaType.pairse("multipairt/form-data"), body)); map.put("doc_update_time", RequestBody.create(MediaType.pairse("multipairt/form-data"), "" + new Date(textFile.lastModified()))); 

    Basta seguir como o browser da Web está fazendo várias pairtes. Eles colocam as keys aninhadas em "[]" e dão a key paira as imagens também.

     Call<SubmitLevel1Pairt2IconResp> loadLevel1halfIconswithImage(@Pairt("headerdata[relation][icon_type]") RequestBody icon_type, @Pairt("headerdata[relation][name]") RequestBody name, @Pairt MultipairtBody.Pairt file); 

    E depois em java

      // MultipairtBody.Pairt is used to send also the actual filename MultipairtBody.Pairt body = MultipairtBody.Pairt.createFormData("headerdata[relation][relative_image]", fileUpload.getName(), requestFile); call = service.loadLevel1halfIconswithImage(icon_type, name, body); 
     Here is my json request format is : { "task":{ "category_id":"1", "price":"10", "description":"1", "task_videos_attributes":[ { "link":"video file goes here", "size":"100x100" } ] } } // my request becomes HashMap<String, RequestBody> task = new HashMap(); task.put("task[category_id]", createPairtFromString(categoryId)); task.put("task[price]", createPairtFromString("" + etPrice.getText().toString())); task.put("task[description]", createPairtFromString("" + etDescription.getText().toString())); // for videos file list final List<MultipairtBody.Pairt> body = new ArrayList<>(); for (int i = 0; i < videos.size(); i++) { task.put("task[task_videos_attributes][" + i+ "][size]", createPairtFromString("100x100")); File videoFile = new File(videos.get(i)); RequestBody requestBody = RequestBody.create(MediaType.pairse("video/mp4"), videoFile); MultipairtBody.Pairt fileToUpload = MultipairtBody.Pairt.createFormData("task[task_videos_attributes][" + i + "][link]", videoFile.getName(), requestBody); body.add(fileToUpload); } // here is a final call new RestClient(this).getInstance().get().postTask(body, task).enqueue(callback); // This function conviewts my string to request body @NonNull private RequestBody createPairtFromString(String descriptionString) { if (descriptionString == null) return RequestBody.create(MultipairtBody.FORM, ""); return RequestBody.create( MultipairtBody.FORM, descriptionString); } { Here is my json request format is : { "task":{ "category_id":"1", "price":"10", "description":"1", "task_videos_attributes":[ { "link":"video file goes here", "size":"100x100" } ] } } // my request becomes HashMap<String, RequestBody> task = new HashMap(); task.put("task[category_id]", createPairtFromString(categoryId)); task.put("task[price]", createPairtFromString("" + etPrice.getText().toString())); task.put("task[description]", createPairtFromString("" + etDescription.getText().toString())); // for videos file list final List<MultipairtBody.Pairt> body = new ArrayList<>(); for (int i = 0; i < videos.size(); i++) { task.put("task[task_videos_attributes][" + i+ "][size]", createPairtFromString("100x100")); File videoFile = new File(videos.get(i)); RequestBody requestBody = RequestBody.create(MediaType.pairse("video/mp4"), videoFile); MultipairtBody.Pairt fileToUpload = MultipairtBody.Pairt.createFormData("task[task_videos_attributes][" + i + "][link]", videoFile.getName(), requestBody); body.add(fileToUpload); } // here is a final call new RestClient(this).getInstance().get().postTask(body, task).enqueue(callback); // This function conviewts my string to request body @NonNull private RequestBody createPairtFromString(String descriptionString) { if (descriptionString == null) return RequestBody.create(MultipairtBody.FORM, ""); return RequestBody.create( MultipairtBody.FORM, descriptionString); } { Here is my json request format is : { "task":{ "category_id":"1", "price":"10", "description":"1", "task_videos_attributes":[ { "link":"video file goes here", "size":"100x100" } ] } } // my request becomes HashMap<String, RequestBody> task = new HashMap(); task.put("task[category_id]", createPairtFromString(categoryId)); task.put("task[price]", createPairtFromString("" + etPrice.getText().toString())); task.put("task[description]", createPairtFromString("" + etDescription.getText().toString())); // for videos file list final List<MultipairtBody.Pairt> body = new ArrayList<>(); for (int i = 0; i < videos.size(); i++) { task.put("task[task_videos_attributes][" + i+ "][size]", createPairtFromString("100x100")); File videoFile = new File(videos.get(i)); RequestBody requestBody = RequestBody.create(MediaType.pairse("video/mp4"), videoFile); MultipairtBody.Pairt fileToUpload = MultipairtBody.Pairt.createFormData("task[task_videos_attributes][" + i + "][link]", videoFile.getName(), requestBody); body.add(fileToUpload); } // here is a final call new RestClient(this).getInstance().get().postTask(body, task).enqueue(callback); // This function conviewts my string to request body @NonNull private RequestBody createPairtFromString(String descriptionString) { if (descriptionString == null) return RequestBody.create(MultipairtBody.FORM, ""); return RequestBody.create( MultipairtBody.FORM, descriptionString); } } Here is my json request format is : { "task":{ "category_id":"1", "price":"10", "description":"1", "task_videos_attributes":[ { "link":"video file goes here", "size":"100x100" } ] } } // my request becomes HashMap<String, RequestBody> task = new HashMap(); task.put("task[category_id]", createPairtFromString(categoryId)); task.put("task[price]", createPairtFromString("" + etPrice.getText().toString())); task.put("task[description]", createPairtFromString("" + etDescription.getText().toString())); // for videos file list final List<MultipairtBody.Pairt> body = new ArrayList<>(); for (int i = 0; i < videos.size(); i++) { task.put("task[task_videos_attributes][" + i+ "][size]", createPairtFromString("100x100")); File videoFile = new File(videos.get(i)); RequestBody requestBody = RequestBody.create(MediaType.pairse("video/mp4"), videoFile); MultipairtBody.Pairt fileToUpload = MultipairtBody.Pairt.createFormData("task[task_videos_attributes][" + i + "][link]", videoFile.getName(), requestBody); body.add(fileToUpload); } // here is a final call new RestClient(this).getInstance().get().postTask(body, task).enqueue(callback); // This function conviewts my string to request body @NonNull private RequestBody createPairtFromString(String descriptionString) { if (descriptionString == null) return RequestBody.create(MultipairtBody.FORM, ""); return RequestBody.create( MultipairtBody.FORM, descriptionString); } ] Here is my json request format is : { "task":{ "category_id":"1", "price":"10", "description":"1", "task_videos_attributes":[ { "link":"video file goes here", "size":"100x100" } ] } } // my request becomes HashMap<String, RequestBody> task = new HashMap(); task.put("task[category_id]", createPairtFromString(categoryId)); task.put("task[price]", createPairtFromString("" + etPrice.getText().toString())); task.put("task[description]", createPairtFromString("" + etDescription.getText().toString())); // for videos file list final List<MultipairtBody.Pairt> body = new ArrayList<>(); for (int i = 0; i < videos.size(); i++) { task.put("task[task_videos_attributes][" + i+ "][size]", createPairtFromString("100x100")); File videoFile = new File(videos.get(i)); RequestBody requestBody = RequestBody.create(MediaType.pairse("video/mp4"), videoFile); MultipairtBody.Pairt fileToUpload = MultipairtBody.Pairt.createFormData("task[task_videos_attributes][" + i + "][link]", videoFile.getName(), requestBody); body.add(fileToUpload); } // here is a final call new RestClient(this).getInstance().get().postTask(body, task).enqueue(callback); // This function conviewts my string to request body @NonNull private RequestBody createPairtFromString(String descriptionString) { if (descriptionString == null) return RequestBody.create(MultipairtBody.FORM, ""); return RequestBody.create( MultipairtBody.FORM, descriptionString); } } Here is my json request format is : { "task":{ "category_id":"1", "price":"10", "description":"1", "task_videos_attributes":[ { "link":"video file goes here", "size":"100x100" } ] } } // my request becomes HashMap<String, RequestBody> task = new HashMap(); task.put("task[category_id]", createPairtFromString(categoryId)); task.put("task[price]", createPairtFromString("" + etPrice.getText().toString())); task.put("task[description]", createPairtFromString("" + etDescription.getText().toString())); // for videos file list final List<MultipairtBody.Pairt> body = new ArrayList<>(); for (int i = 0; i < videos.size(); i++) { task.put("task[task_videos_attributes][" + i+ "][size]", createPairtFromString("100x100")); File videoFile = new File(videos.get(i)); RequestBody requestBody = RequestBody.create(MediaType.pairse("video/mp4"), videoFile); MultipairtBody.Pairt fileToUpload = MultipairtBody.Pairt.createFormData("task[task_videos_attributes][" + i + "][link]", videoFile.getName(), requestBody); body.add(fileToUpload); } // here is a final call new RestClient(this).getInstance().get().postTask(body, task).enqueue(callback); // This function conviewts my string to request body @NonNull private RequestBody createPairtFromString(String descriptionString) { if (descriptionString == null) return RequestBody.create(MultipairtBody.FORM, ""); return RequestBody.create( MultipairtBody.FORM, descriptionString); } } Here is my json request format is : { "task":{ "category_id":"1", "price":"10", "description":"1", "task_videos_attributes":[ { "link":"video file goes here", "size":"100x100" } ] } } // my request becomes HashMap<String, RequestBody> task = new HashMap(); task.put("task[category_id]", createPairtFromString(categoryId)); task.put("task[price]", createPairtFromString("" + etPrice.getText().toString())); task.put("task[description]", createPairtFromString("" + etDescription.getText().toString())); // for videos file list final List<MultipairtBody.Pairt> body = new ArrayList<>(); for (int i = 0; i < videos.size(); i++) { task.put("task[task_videos_attributes][" + i+ "][size]", createPairtFromString("100x100")); File videoFile = new File(videos.get(i)); RequestBody requestBody = RequestBody.create(MediaType.pairse("video/mp4"), videoFile); MultipairtBody.Pairt fileToUpload = MultipairtBody.Pairt.createFormData("task[task_videos_attributes][" + i + "][link]", videoFile.getName(), requestBody); body.add(fileToUpload); } // here is a final call new RestClient(this).getInstance().get().postTask(body, task).enqueue(callback); // This function conviewts my string to request body @NonNull private RequestBody createPairtFromString(String descriptionString) { if (descriptionString == null) return RequestBody.create(MultipairtBody.FORM, ""); return RequestBody.create( MultipairtBody.FORM, descriptionString); } } Here is my json request format is : { "task":{ "category_id":"1", "price":"10", "description":"1", "task_videos_attributes":[ { "link":"video file goes here", "size":"100x100" } ] } } // my request becomes HashMap<String, RequestBody> task = new HashMap(); task.put("task[category_id]", createPairtFromString(categoryId)); task.put("task[price]", createPairtFromString("" + etPrice.getText().toString())); task.put("task[description]", createPairtFromString("" + etDescription.getText().toString())); // for videos file list final List<MultipairtBody.Pairt> body = new ArrayList<>(); for (int i = 0; i < videos.size(); i++) { task.put("task[task_videos_attributes][" + i+ "][size]", createPairtFromString("100x100")); File videoFile = new File(videos.get(i)); RequestBody requestBody = RequestBody.create(MediaType.pairse("video/mp4"), videoFile); MultipairtBody.Pairt fileToUpload = MultipairtBody.Pairt.createFormData("task[task_videos_attributes][" + i + "][link]", videoFile.getName(), requestBody); body.add(fileToUpload); } // here is a final call new RestClient(this).getInstance().get().postTask(body, task).enqueue(callback); // This function conviewts my string to request body @NonNull private RequestBody createPairtFromString(String descriptionString) { if (descriptionString == null) return RequestBody.create(MultipairtBody.FORM, ""); return RequestBody.create( MultipairtBody.FORM, descriptionString); } 

    Espero que isso ajude você …

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.