Skip to content

Support both the console and browser equally #20068

Closed
@nex3

Description

@nex3

The http package should support IOClient and BrowserClient on even footing. "new http.Client()" should dynamically choose between them based on which is supported.

Activity

nex3

nex3 commented on Jul 15, 2014

@nex3
MemberAuthor

Marked this as being blocked by #6943.

DartBot

DartBot commented on Aug 9, 2014

@DartBot

This comment was originally written by mi...@apaq.dk


This would be awesome.

In my particular case I'm building a client library for a Rest service. My first priority is to build a CLI application using the Client and for that purpose I will need to use the dart:io's HttpRequest. But I want to reuse the Client lib for a Web Interface later on and will then need to use dart:html's HttpRequest.

In order to make that work I have to build wrappers for each HttpRequests.

nex3

nex3 commented on Aug 11, 2014

@nex3
MemberAuthor

It's worth noting that you can use the http package on both the browser and the console today; you just need to explicitly choose to instantiate either an IOClient or a BrowserClient and pass it in to the code in question.

DartBot

DartBot commented on Aug 12, 2014

@DartBot

This comment was originally written by mi...@apaq.dk


Huh. Why didn't I notice that until now? Please excuse a newbie. :)

Reading "http package" I was just thinking of some future http functionality - I didn't know it was a package that already existed. Thank you for guiding me.

self-assigned this
on Aug 12, 2014
DartBot

DartBot commented on Jun 5, 2015

@DartBot

This issue has been moved to dart-lang/http#22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-pkgUsed for miscellaneous pkg/ packages not associated with specific area- teams.type-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @nex3@kevmoo@DartBot

      Issue actions

        Support both the console and browser equally · Issue #20068 · dart-lang/sdk