Now i`m adding array as string to body:
RequestBody body = new FormEncodingBuilder()
.add("profiles", "[122, 125, 336]")
.build();
But the server need array on post parameter. How can i add array instead of string? Is it posible with okhttp?
You are currently posting profiles
as a string. You will want to mimic a POST for a checkbox form field for profiles
RequestBody body = new FormEncodingBuilder()
.add("profiles[0]", "122")
.add("profiles[1]", "125")
.add("profiles[2]", "336")
.build();
more info and good reading,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With