Anshuman Pattnaik Anshuman Pattnaik - 7 months ago 68
Android Question

How to post JSON Array in retrofit using android?

I am working on retrofit but i have no idea how to post JSONArray in retrofit, i am posting the sample JSON please kindly go through it.

"tab": [{
"menu_item_id": "",
"cost": 0,
"quantity": 0,
"name": ""

I am able to create JSONObject model but i am facing some issue in JSONArray model please kindly go through my sample JSON and suggest me some solution.


How did you declare the post method in your api interface? It should be something like this:

void postItemsMethod(@Field("tabs[]") ArrayList<YourItemClass> tabs , Callback<CallBackClass> callback);