We have this code which we are using to post data from an Android app to a .Net Rest service. One of the fields that the backend is and array. Swagger specifies it as
modelbinding Array[integer]
How should we put the value array of integers in the urlParameters so we can post it?
String urlParameters = "field1=abc&field2=def";
URL url = new URL(targetURL);
connection = (HttpURLConnection)url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", contentType);
connection.setRequestProperty("Accept-Charset", "UTF-8");
connection.setUseCaches (false);
connection.setDoInput(true);
connection.setDoOutput(true);
// Send request
writer = new DataOutputStream (connection.getOutputStream ());
BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(writer, "UTF-8"));
bufferedWriter.write(urlParameters);
bufferedWriter.flush ();
bufferedWriter.close ();