【发布时间】:2016-09-10 13:55:34
【问题描述】:
我正在尝试使用 Retrofit2 解析 JSON 文件 想加个body(参数)
网址如:domain.com/list-all/
{"userId": 7446,"pages":25}
JSON 响应看起来像这种格式
{
"todaysList": [
{
"automatic": false,
"city": "Trivandrum",
"countryName": "IND",
"firstName": "Sarojam",
"flagExists": true,
"flagPath": "url",
"friendReqStatus": 0,
"fullName": " M",
"gender": "F",
"inRequest": false,
"lastName": "M",
"optOut": false,
"outRequest": false,
"position": 1,
"profileExist": false,
"todaysWinner": false,
"userId": 20726,
},
{
"automatic": false,
"city": "Trivandrum",
"countryName": "IND",
"firstName": "Sarojam",
"flagExists": true,
"flagPath": "url",
"friendReqStatus": 0,
"fullName": " M",
"gender": "F",
"inRequest": false,
"lastName": "M",
"optOut": false,
"outRequest": false,
"position": 1,
"profileExist": false,
"todaysWinner": false,
"userId": 20726
},
....
}
我如何使用 POST 解析它,并使用 Retrofit2 使用两个主体参数
【问题讨论】:
标签: android json post get retrofit2