Future getServerDataWithDio() async {
BaseOptions options = BaseOptions(
baseUrl: 'https://www.abc.com',
connectTimeout: 3000,
receiveTimeout: 3000,
);
Dio dio = Dio(options);
var formData = FormData.fromMap({
"search": "홍길동",
});
try {
Response resp = await dio.post(
"/androidSample/putData_Flutter.php",
data: formData,
);
// print("Response:");
// print("Status: ${resp.statusCode}");
// print("Header:\n${resp.headers}");
print("Data:\n${resp.data}");
} catch (e) {
print("Exception: $e");
}
}
이렇게 할 경우 잘 한글 변수가 처리됨을 확인했습니다.