I have a web service in which I have to pass parameters in Json. But the problem is jsonObject have one key with jsonobject type and that jsonobject have one key with again son type. It is pretty confusing but I can show you my final result with son object.
{
"Id": 1,
"Company": "BMW",
"Category": {
"ID": 1,
"Transmission": 1,
"Fuel": 2,
"Description": {
"Price": 1200000,
"Year": 2016
}
}
}
Now I want to send it in URLconnection. What should I do?
I create 3 Json objects with description,Category,and final son and then converted it to String with toString(). putted Description in Category and Category in final son with “Category” key But its not working server is giving error.
I am very new to android and don’t have much idea about it. Any suggestion will be useful.
Edited I already tried that link but still not solved my problem.
if you want to use URLConnection.. you might want to see this thread
POST request send json data java HttpUrlConnection