How to send array at POST request, example sending body(param->value):
{"chat":["560e8befef36415027432170", "560e8bfabd0a2d2427189eab"]}
I tried make with this method, but not successful:
`
@FormUrlEncoded
@POST("/v1/rooms/{roomId}")
void readMessages(@Path("roomId") String roomId, @Field("chat") String[] ids, Callback
How I make it on Retrofit 1.9.0?
`
how to send a array data,try
@Query("chat[]") String[] ids
The format you define is JSON, not form encoding. For this you would create an object with that format like:
class Foo {
List<String> chat;
}
paired with the @Body annotation on a single parameter.
thanks this is work for me
Most helpful comment
The format you define is JSON, not form encoding. For this you would create an object with that format like:
paired with the
@Bodyannotation on a single parameter.