We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting this error when using a post method this is TrackTrace : #0 CastMap.forEach. (dart:_internal/cast.dart:288:25) #1 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:400:8) #2 CastMap.forEach (dart:_internal/cast.dart:287:13) #3 mapToQuery (package:http/src/utils.dart:17:7) #4 Request.bodyFields= (package:http/src/request.dart:137:12) #5 BaseClient._sendUnstreamed (package:http/src/base_client.dart:87:17) #6 BaseClient.post (package:http/src/base_client.dart:32:7) #7 post. (package:http/http.dart:69:16) #8 _withClient (package:http/http.dart:164:20) #9 post (package:http/http.dart:68:5) #10 Api.httpPost (package:knorrieplay/services/api.dart:33:14) #11 UserService.addUser (package:knorrieplay/services/user_service.dart:8:18) #12 AuthProvider.signInWithFacebook (package:knorrieplay/providers/auth_provider.dart:219:23) #13 _LoginPageState.facebookAuth (package:knorrieplay/pages/login_page.dart:89:18) the method i used Future<http.Response?> httpPost(String endPath, Object body) async { try { Uri uri = Uri.parse('$url$endPath'); return http.post(uri, body: body, headers: headers); } catch (e) { print(e); } }
::::::::::: when i use dio it works fine
The text was updated successfully, but these errors were encountered:
The doc comment on http.post says:
http.post
body sets the body of the request. It can be a String, a List<int> or a Map<String, String>.
body
String
List<int>
Map<String, String>
You have passed a Map which contains a value that is null, which is not a String.
Map
null
Sorry, something went wrong.
No branches or pull requests
Getting this error when using a post method
this is TrackTrace : #0 CastMap.forEach. (dart:_internal/cast.dart:288:25)
#1 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:400:8)
#2 CastMap.forEach (dart:_internal/cast.dart:287:13)
#3 mapToQuery (package:http/src/utils.dart:17:7)
#4 Request.bodyFields= (package:http/src/request.dart:137:12)
#5 BaseClient._sendUnstreamed (package:http/src/base_client.dart:87:17)
#6 BaseClient.post (package:http/src/base_client.dart:32:7)
#7 post. (package:http/http.dart:69:16)
#8 _withClient (package:http/http.dart:164:20)
#9 post (package:http/http.dart:68:5)
#10 Api.httpPost (package:knorrieplay/services/api.dart:33:14)
#11 UserService.addUser (package:knorrieplay/services/user_service.dart:8:18)
#12 AuthProvider.signInWithFacebook (package:knorrieplay/providers/auth_provider.dart:219:23)
#13 _LoginPageState.facebookAuth (package:knorrieplay/pages/login_page.dart:89:18)
the method i used
Future<http.Response?> httpPost(String endPath, Object body) async {
try {
Uri uri = Uri.parse('$url$endPath');
return http.post(uri, body: body, headers: headers);
} catch (e) {
print(e);
}
}
::::::::::: when i use dio it works fine
The text was updated successfully, but these errors were encountered: