-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flutter web - simple request causing OPTIONS request #2125
Comments
Could share a corresponding example which it can works as a simple request with other libraries? |
Above example of multipart request should and is working as simple in different libraries eg. http. You can replace stampPosVertical, stampPosHorizontal with any string and remove file property. Also in this thread #1601 there are written rules for simple request. |
As "Simple requests" defines:
The code here gives a detailed explanation: dio/dio/lib/src/adapters/browser_adapter.dart Lines 106 to 114 in ccc7666
|
So the way to avoid getting CORS is not using the |
Package
dio
Version
5.4.1
Operating-System
Web
Output of
flutter doctor -v
Dart Version
3.3.0
Steps to Reproduce
I am trying to send Simple multipart request as above example. When I am doing it using http package on server side I am receiving this request, but when I am using dio, before getting normal POST request I am getting OPTIONS request even though my request meets all requirements to be simple. At some point DIO is modifying headers or something else which cause sending OPTIONS request.
the same issue, i dont know why is was closed #1601
Expected Result
Actual Result
1.Make simple request - POST to server using dio.
2. Receive OPTIONS request instead of POST even though it was simple request and after that receive actual post.
The text was updated successfully, but these errors were encountered: