When using get request in flutter using dio
Even though host/url is correct it still showed error saying invalid host
I was fetching data from data base and present it in a table using django
The data fetched using get is visible in browser howsoever
The post request runs without issue
2
Answers
AndroidManifest.xml
I faced a issue where data from Django rest framework was not showing in Flutter through Dio. But in Postman everything was alright.
I thought problem was in Flutter. Then I found out I didn’t allowed host in Django settings.py file. I added this
and at the end of the file added this
CORS_ALLOW_ALL_ORIGINS = True
It solved my problem.