i'm using Ion library for posting data on server database in string name/value pairs and getting JSON response. Say you have a table 'A' in Database with Attributes 'x' and 'y' (say varchars), so you can post a record in table like this :
Ion.with(getContext())
.load("https://abc/api/A")
.setBodyParameter("x", "somevalue")
.setBodyParameter("y", "anothervalue")
.asString()
I want to post a number of records to be inserted in table at once, what i'm doing is :
Ion.with(getContext())
.load("https://abc/api/A")
.setBodyParameter("x[0]", "somevalue")
.setBodyParameter("y[0]", "anothervalue")
.setBodyParameter("x[1]", "somevalue")
.setBodyParameter("y[1]", "anothervalue")
.setBodyParameter("x[2]", "somevalue")
.setBodyParameter("y[2]", "anothervalue")
.asString()
if anybody is familiar with ion , please guide me. Here is the link to github project of Ion : https://github.com/koush/ion