title: How to add ArrayList of Integers to MultipartBody
body: <p>I have an ArrayList of Integers that I need to put into my MultipartBody.Builder. I have tried using different methods of .addFormDataPart, even tried to convert the arraylist to a JSONObject and then the JSONObject to a string, but my server would return an error like:</p>
  
  <blockquote>
    <p>{"tags":["Incorrect type. Expected pk value, received str."]}</p>
  </blockquote>
  
  <p>My json on the server is formatted like this </p>
  
  <pre><code>{"id":1, 
   "tags" : [
             {"id":1}, 
             {"id":2}
            ]
  }
  </code></pre>
  
  <p>and in android studio I am trying to put in an ArrayList of integers that contain the tags id's like this</p>
  
  <pre><code>okhttp3.RequestBody fileRequestBody =  RequestBody.create(MediaType.parse("text/csv"), file); 
  
  okhttp3.RequestBody requestBody = new MultipartBody.Builder()
                          .setType(MultipartBody.FORM)
                          .addFormDataPart("id", projecID)
                          .addFormDataPart("tags", tagIDArray")
                          .addFormDataPart("file", "file", fileRequestBody).build();
  </code></pre>