开发者

How to make a request for sending a list of rows in a rest client -Android

开发者 https://www.devze.com 2023-03-11 04:57 出处:网络
I am working on a REST client in android.My web service开发者_如何学Go is based on Rails.My scenario is that I have an classnamed user which has attributes like age,name,gender etc.I want to send a li

I am working on a REST client in android.My web service开发者_如何学Go is based on Rails.My scenario is that I have an class named user which has attributes like age,name,gender etc.I want to send a list of user objects to the server so that i can insert it into the database.Can someone let me know how i can do this using json?


Have your user class be a JSONObject and then post the objects to your server as JSON strings using JSONObject.quote() and turn those strings back into arrays/objects at the server end.

0

精彩评论

暂无评论...
验证码 换一张
取 消