我的API是:如何發送JSONArray無鑰匙「值」
public interface API {
@PUT("pedido/{lanche}")
Observable<OrderResponseVO> createOrder(@Path("lanche") Integer lanche, @Body AddOrderRequestVO request);
}
我用我的改造PUT請求體這個POJO:
public class AddOrderRequestVO {
@SerializedName("extras")
public JSONArray itens;it
}
我收到這身在我的服務器:
{ extras: { values: [ 2, 2, 2 ] } }
,但我需要這樣的:
{ extras: [ 2, 2, 2 ] }
這是怎麼回事?
難道你只是解析JSON,然後處理結構? – Carcigenicate
改造+ gson的想法是抽象的這個過程。 –
而不是用'extra'初始化對象,用'values'初始化它 – iTurki