Skip to content
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

http.post does not return #203

Closed
shtengel opened this issue Sep 28, 2018 · 3 comments
Closed

http.post does not return #203

shtengel opened this issue Sep 28, 2018 · 3 comments

Comments

@shtengel
Copy link

i wrote it here: https://stackoverflow.com/questions/52552002/flutter-http-post-never-returns-a-response

but TLDR;

  print("before");
  http.Response res = await http.post(url, body:data);
  print("after");

code never reaches the print("after");
but my server does get the HTTP POST request..

please help me

@zoechi
Copy link

zoechi commented Sep 28, 2018

What happens if you access the same URL with wget or curl?

@shtengel
Copy link
Author

now i see after a while i get this error
E/flutter ( 7721): [ERROR:flutter/shell/common/shell.cc(181)] Dart Error: Unhandled exception:
E/flutter ( 7721): Connection closed while receiving data
E/flutter ( 7721): #0 IOClient.send. (package:http/src/io_client.dart:52:15)
E/flutter ( 7721): #1 _invokeErrorHandler (dart:async/async_error.dart:13:29)
E/flutter ( 7721): #2 _HandleErrorStream._handleError (dart:async/stream_pipe.dart:286:9)
E/flutter ( 7721): #3 _ForwardingStreamSubscription._handleError (dart:async/stream_pipe.dart:168:13)
E/flutter ( 7721): #4 _RootZone.runBinaryGuarded (dart:async/zone.dart:1326:10)
E/flutter ( 7721): #5 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:355:15)
E/flutter ( 7721): #6 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:373:16)
E/flutter ( 7721): #7 _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:272:7)
E/flutter ( 7721): #8 _ForwardingStreamSubscription._addError (dart:async/stream_pipe.dart:137:11)
E/flutter ( 7721): #9 _addErrorWithReplacement (dart:async/stream_pipe.dart:188:8)
E/flutter ( 7721): #10 _HandleErrorStream._handleError (dart:async/stream_pipe.dart:291:11)
E/flutter ( 7721): #11 _ForwardingStreamSubscription._handleError (dart:async/stream_pipe.dart:168:13)
E/flutter ( 7721): #12 _RootZone.runBinaryGuarded (dart:async/zone.dart:1326:10)
E/flutter ( 7721): #13 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:355:15)
E/flutter ( 7721): #14 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:373:16)
E/flutter ( 7721): #15 _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:272:7)
E/flutter ( 7721): #16 _SyncStreamController._sendError (dart:async/stream_controller.dart:767:19)
E/flutter ( 7721): #17 _StreamController._addError (dart:async/stream_controller.dart:647:7)
E/flutter ( 7721): #18 _StreamController.addError (dart:async/stream_controller.dart:599:5)
E/flutter ( 7721): #19 _HttpParser._onDone (dart:_http/http_parser.dart:822:25)
E/flutter ( 7721): #20 _RootZone.runGuarded (dart:async/zone.dart:1302:10)
E/flutter ( 7721): #21 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:389:13)
E/flutter ( 7721): #22 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399:15)
E/flutter ( 7721): #23 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:283:7)
E/flutter ( 7721): #24 _SyncStreamController._sendDone (dart:async/stream_controller.dart:771:19)
E/flutter ( 7721): #25 _StreamController._closeUnchecked (dart:async/stream_controller.dart:628:7)
E/flutter ( 7721): #26 _StreamController.close (dart:async/stream_controller.dart:621:5)
E/flutter ( 7721): #27 _Socket._onData (dart:io/runtime/binsocket_patch.dart:1721:21)
E/flutter ( 7721): #28 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
E/flutter ( 7721): #29 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
E/flutter ( 7721): #30 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
E/flutter ( 7721): #31 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
E/flutter ( 7721): #32 _StreamController._add (dart:async/stream_controller.dart:639:7)
E/flutter ( 7721): #33 _StreamController.add (dart:async/stream_controller.dart:585:5)
E/flutter ( 7721): #34 new _RawSocket. (dart:io/runtime/binsocket_patch.dart:1283:35)
E/flutter ( 7721): #35 _NativeSocket.issueReadEvent.issue (dart:io/runtime/binsocket_patch.dart:812:18)
E/flutter ( 7721): #36 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
E/flutter ( 7721): #37 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)

@shtengel
Copy link
Author

ok found it. the problem was the server didn't close the connection to the client thanks anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants