-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
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
[dio] Some map response returns null but using Postman can see the field with the correct result #1890
Labels
Comments
fakhravari
added
h: need triage
This issue needs to be categorized
s: bug
Something isn't working
labels
Jul 10, 2023
This comment was marked as outdated.
This comment was marked as outdated.
AlexV525
changed the title
Null output if displayed in postman
[dio] Some map response returns null but using Postman can see the field with the correct result
Jul 14, 2023
I can reproduce this using the below code: import 'package:dio/dio.dart';
import 'package:test/test.dart';
void main() {
test('request something', () async {
final response = await Dio().post(
'https://mobiletest.pmlm.ir/pisc/v3/LoginCustomer',
data: {'UserName': '3501578873', 'Password': '12345', 'IdLanguage ': 1},
);
print(response);
});
} |
import 'dart:convert';
import 'package:flutter_test/flutter_test.dart';
import 'package:dio/dio.dart';
import 'package:http/http.dart' as http;
void main() {
test('request Dio', () async {
final response = await Dio().post(
'https://mobiletest.pmlm.ir/pisc/v3/LoginCustomer',
data: {'UserName': '3501578873', 'Password': '12345', 'IdLanguage ': 1},
);
print(response);
});
test('request Http', () async {
var url = Uri.parse('https://mobiletest.pmlm.ir/pisc/v3/LoginCustomer');
var response = await http.post(
url,
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: jsonEncode(
{'UserName': '3501578873', 'Password': '12345', 'IdLanguage ': 1}),
);
print(response.body);
});
} Recording.2023-07-15.094215.mp4 |
After debugging what's happened to your requests, the For
For
To make both requests the same, since
Closing as invalid usages. |
AlexV525
added
i: out of support
and removed
p: dio
Targeting `dio` package
s: bug
Something isn't working
labels
Jul 15, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Package
dio
Version
5.1.2
Output of
flutter doctor -v
No response
Dart Version
No response
Steps to Reproduce
1
Expected Result
I test with package http, it shows responce in the output, but it is null in the output dio.
Recording.2023-07-10.150840.mp4
Actual Result
UserName:3501578873
Password:12345
IdLanguage:1
https://mobiletest.pmlm.ir/pisc/v3/LoginCustomer
The text was updated successfully, but these errors were encountered: