Unable to add header for post method in dio in Flutter

5 min read

Dio library key working perfectly fine in my case if we pass small case key value

For example,

Dio dio = new Dio();
dio.options.headers['content-Type'] = 'application/json';
dio.options.headers["authorization"] = "token ${token}";
response = await dio.post(url, data: data);