XmlHttpRequest error

288 views
Skip to first unread message

Ilker Gul (Student)

unread,
Apr 26, 2021, 3:11:04 PM4/26/21
to Flutter Development (flutter-dev)
Hi, I am using Django as backend and implemented CORS, it works in mobile version but it does not work in Web. What is the problem please help me
I run Django on local and I also get this message when I try to run the app on web

"POST /e_commerce/getproduct HTTP/1.1" 200 278

Error: XMLHttpRequest error.
    dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 906:28                get current
packages/http/src/browser_client.dart 71:22                                       <fn>
dart-sdk/lib/async/zone.dart 1612:54                                              runUnary
dart-sdk/lib/async/future_impl.dart 152:18                                        handleValue
dart-sdk/lib/async/future_impl.dart 704:44                                        handleValueCallback
dart-sdk/lib/async/future_impl.dart 733:13                                        _propagateToListeners
dart-sdk/lib/async/future_impl.dart 530:7                                         [_complete]
dart-sdk/lib/async/stream_pipe.dart 61:11                                         _cancelAndValue
dart-sdk/lib/async/stream.dart 1219:7                                             <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 324:14  _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 329:39  dcall
dart-sdk/lib/html/dart2js/html_dart2js.dart 37307:58                              <fn>


    at Object.createErrorWithStack (http://localhost:49814/dart_sdk.js:5347:12)
    at async._AsyncCallbackEntry.new.callback (http://localhost:49814/dart_sdk.js:39343:13)
    at Object._microtaskLoop (http://localhost:49814/dart_sdk.js:39175:13)
    at _startMicrotaskLoop (http://localhost:49814/dart_sdk.js:39181:13)

Joedson Gabriel Alves Da Silva

unread,
Apr 26, 2021, 3:59:22 PM4/26/21
to Flutter Development (flutter-dev)

check the cors allowed hosts on django settings file

Ilker Gul (Student)

unread,
Apr 26, 2021, 4:07:41 PM4/26/21
to Flutter Development (flutter-dev)
Thank you very much. I will check it as soon as possible
Sincerely

Reply all
Reply to author
Forward
0 new messages