Sending request to API with authorization and other headers, its returning unauthorized. it seems like server is not getting headers while requesting. i tried different approaches to send http headers on request but failed. I tried Dio , HttpClient, Normal http request all are failed. I spent my 2 days on this thing, still not resolved. from Postman, and other mediums request is working.
Map<String,String> reqHeaders = {
'Content-type': 'application/json',
'Accept': 'application/json',
"Authorization": "xxxxx",
"langapi": "en"
};
Future<MzResponseData> getHttp() async {
var dio = Dio();
dio.options.baseUrl = baseUrl;
dio.options.headers = reqHeaders;
dio.options.contentType = ContentType.parse("application/json");
Response response = await dio.get("/uri/");
print(response);
}