DioException [connection error]: The connection errored:

I am getting this error while connecting with API
DioException [connection error]: The connection errored:

Hey @NGChintamani First of all welcome to our community! We are happy to have you here.

So error can be because of one many possible issues, for example:

  • Are you sure the API is working? to do a double-check, use Postman for testing
  • Are you sure the information like the baseURL and endpoints are entered correctly?
  • If you are using the browser, like Chrome, then you might be facing Cross-Origin Resource Sharing (CORS) problem. It means that the browser won’t allow you to fire requests to a different domain that the web app. To solve this, you need to
    • Find a plugin to allow CORS, or Disable CORS Policy in your brower.
    • Use Desktop version instead

This link will be very helpful for you.

Please try the above solutions and it should work afterwards :slight_smile: