-
Notifications
You must be signed in to change notification settings - Fork 363
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
Add a dart:html client #83
Conversation
The |
lib/browser_client.dart
Outdated
Future<StreamedResponse> send(BaseRequest request) async { | ||
var bytes = await request.finalize().toBytes(); | ||
Future<Response> send(Request request) async { | ||
var stream = new ByteStream(request.read()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really want to kill ByteStream
, so we shouldn't use it here. You can pull this functionality into a function in utils/
, although really it should live in a package somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears it IS in a package 👍
lib/browser_client.dart
Outdated
headers: xhr.responseHeaders, | ||
reasonPhrase: xhr.statusText)); | ||
reasonPhrase: xhr.statusText, | ||
body: new ByteStream.fromBytes(body), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also shouldn't be a ByteStream
. In this case, just new Stream.fromIterable([body])
should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@nex3 ? |
Nice! Another one down 😄 |
Adding the browser_client.dart implementation