Skip to content

_BoundSinkStream Error #15110

@dovahkiin98

Description

@dovahkiin98

I'm using Dart 2 and when I try to make an HTTP GET request, This error is shown

[ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter (21922): type '_BoundSinkStream<dynamic, List<int>>' is not a subtype of type '_HttpIncoming' where
E/flutter (21922):   _BoundSinkStream is from dart:async
E/flutter (21922):   List is from dart:core
E/flutter (21922):   int is from dart:core
E/flutter (21922):   List is from dart:core
E/flutter (21922):   int is from dart:core
E/flutter (21922):   _HttpIncoming is from dart:_http
E/flutter (21922):   List is from dart:core
E/flutter (21922):   int is from dart:core

this is my code

Future<Stream<Device>> getDevices() async {
  var httpClient = HttpClient();
  var uri = Uri.http('x.aba.ae', '/x.php');
  HttpClientRequest request = await httpClient.getUrl(uri);
  HttpClientResponse response = await request.close();

  return response 
      .transform(UTF8.decoder)
      .transform(JSON.decoder)
      .asyncMap((json) => Device.fromJson(json));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions