это мой json, мне нужно опубликовать все эти
{
"name": "name",
"type": "cash",
"PaymentStatus": true
"CartItems": [
{
"ProductId": 1,
"ProductName": "sample string 2",
"Quantity": 3,
"UnitPrice": 4.1,
"Price": 5.1
},{
"ProductId": 1,
"ProductName": "sample string 2",
"Quantity": 3,
"UnitPrice": 4.1,
"Price": 5.1
}
]
}
Это мой модифицированный интерфейс ApiService
@Multipart
@POST("Addtocart")
Call<AddtoCartRes> createOrder(@Body Order order,
@HeaderMap HashMap<String,String> headerMap,
@Path("name") String ShopUserName,
@Path("type") String ShopName,
@Path("PaymentStatus") String SalesLogin
);
, а это мой класс Order @SerializedName ("CartItems")Список orderDetailList;
public List<Cart> getOrderDetailList() {
return orderDetailList;
}
public void setOrderDetailList(List<Cart> orderDetailList) {
this.orderDetailList = orderDetailList;
}