Home Ask Login Register

Developers Planet

Your answer is one click away!

Waseem Akram February 2016

I want to post array param in HttpURLConnection android

I am a fresher in developing Android apps, in my app I want to post params in the format below:


I am not able to send the user_ids in array format. I am receiving the user_ids as string in my Rails API.

I am using HttpURLConnection, and in my writer.write() I am passing my post params as


Please help.


Waseem Akram February 2016

If any one facing the same problem, I found a work around. You need to add the array in a string

1. Step 1

Create a final ArrayList<String> SelectedTagIds = new ArrayList<String>();

and add the array items using


2. Step 2



3. Step 3

Format the String by replacing the string to


4 Step 4

Finally post the String to the server (I used HttpURLConnection to post my data to the server), and in the server code, convert the received SelectedTagIds to Array and loop accordingly to achieve you'r desired result.

Post Status

Asked in February 2016
Viewed 2,386 times
Voted 9
Answered 1 times


Leave an answer

Quote of the day: live life