【发布时间】:2020-12-24 10:38:24
【问题描述】:
您好,我有一个问题 这些是我的 http 正文和标头,我想将其转换为邮递员请求的预期请求
其中格式为 JSON 格式
var response = await http.post(
'${UIData.baseAppUrl}/api/v1/endpoint',
body: {
"device_id": "$deviceId",
"country_id": "$countryId",
"contacts": [
{
"name": "test",
"email": "test@test.com",
"phone": "+911111111110"
},
{
"name": "Test 2",
"email": "test2@test2.com",
"phone": "+910000000000"
}
]
},
headers: {
"Accept": "application/json",
"Authorization": "Bearer $token"
},
但是当我运行这个时,我会得到这个
type 'List<Map<String, String>>' is not a subtype of type 'String' in type cast
如果有人可以帮助我,请提前找到解决方案,谢谢
【问题讨论】:
标签: flutter http networking https http-headers