cfug / dio

A powerful HTTP client for Dart and Flutter, which supports global settings, Interceptors, FormData, aborting and canceling a request, files uploading and downloading, requests timeout, custom adapters, etc.
https://dio.pub
MIT License
12.44k stars 1.51k forks source link

Prompt for not simple requests on Web #2201

Open AlexV525 opened 5 months ago

AlexV525 commented 5 months ago

Request Statement

People usually wonder why their requests are being treated as CORS. Various of configuration could lead to the result before people can realize, such as connectTimeout and sendTimeout across platforms.

Solution Brainstorm

We might find relevant cases to add logs about "You're making a complex Web request which might lead to CORS" or add more messages when specific exceptions were thrown on the Web platform.

kuhnroyal commented 5 months ago

From what I remember, there are no useful exceptions in a lot of cases. Wonder if we could add some sanity checks for common problems and provide suggestions.

AlexV525 commented 5 months ago

Wonder if we could add some sanity checks for common problems and provide suggestions.

Exactly, and that would be the thing we'll feel great because the community would love such sweet words