My code is :
var header = {"cookie": db.getString("cookie")};
var body={"nonce":_nonce.nonce,"action":"GetTrafficList" ,"params":{"filters":{"credit":{"mode":"none"}}}};
var response = await post(Urls.traffics, headers: header,body:body);
The following error occurs when executing :
Restarted application in 4,619ms.
E/flutter (22004): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: type '_InternalLinkedHashMap<String, Map<String, Map<String, String>>>' is not a subtype of type 'String' in type cast
E/flutter (22004): #0 CastMap.forEach.<anonymous closure> (dart:_internal/cast.dart:288:25)
E/flutter (22004): #1 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
E/flutter (22004): #2 CastMap.forEach (dart:_internal/cast.dart:287:13)
E/flutter (22004): #3 mapToQuery (package:http/src/utils.dart:17:7)
E/flutter (22004): #4 Request.bodyFields= (package:http/src/request.dart:137:12)
E/flutter (22004): #5 BaseClient._sendUnstreamed (package:http/src/base_client.dart:170:17)
E/flutter (22004): #6 BaseClient.post (package:http/src/base_client.dart:58:7)
E/flutter (22004): #7 post.<anonymous closure> (package:http/http.dart:70:16)
E/flutter (22004): #8 _withClient (package:http/http.dart:166:20)
E/flutter (22004): #9 post (package:http/http.dart:69:5)
E/flutter (22004): #10 Traffic.GetTraffic (package:adsl_tci/Traffic.dart:23:26)
E/flutter (22004): <asynchronous suspension>
I think the problem is with the body content :
