Commit Graph

111 Commits

Author SHA1 Message Date
nweiz@google.com 6d63acfccd Support a user-supplied dart:io client in pkg/http.
R=jmesserly@google.com
BUG=18871

Review URL: https://codereview.chromium.org//299483002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36319 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-19 19:55:35 +00:00
nweiz@google.com 03f3a70104 Fix an analyzer error in pkg/http.
R=rnystrom@google.com

Review URL: https://codereview.chromium.org//263313003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35761 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-05 20:00:24 +00:00
nweiz@google.com 97e95bb956 Rip out the last dart:io dependency from pkg/http.
It now loads dart:io via mirrors if it's available. This allows it to be
compatible with the browser, so a new library "package:http/browser_client.dart"
is added to support that.

The use of mirrors was tested to ensure that it doesn't add any additional
filesize to dart2js compilations over what would be used if "dart:io" support
didn't exist.

R=rnystrom@google.com

Review URL: https://codereview.chromium.org//261763002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35756 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-05 19:36:22 +00:00
nweiz@google.com 7e19a6f38e Move the HTTP library documentation to the README.
R=rnystrom@google.com

Review URL: https://codereview.chromium.org//263563005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35605 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-01 00:44:53 +00:00
nweiz@google.com 8e33fe1a72 Rip out dart:io from pkg/http wherever possible.
This uses the http_parser package instead of dart:io's ContentType,
ByteConversionSink instead of ByteBuffer, and a new ClientException type instead
of HttpException.

This still uses dart:io for the default Client implementation and for
[MultipartFile.fromPath].

R=rnystrom@google.com

Review URL: https://codereview.chromium.org//216603010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34716 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-03 18:29:14 +00:00
nweiz@google.com a750dea380 Make MultipartRequest more closely adhere to browsers' behavior.
R=rnystrom@google.com
BUG=17899

Review URL: https://codereview.chromium.org//218993016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34631 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-02 01:08:52 +00:00
nweiz@google.com 6a3508ced0 Fix a bug in [http.BaseRequest.send]'s content length handling.
BUG=
R=kevmoo@google.com

Review URL: https://codereview.chromium.org//215533005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34571 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-31 19:16:38 +00:00
nweiz@google.com 0a2af15099 Make BaseRequest.contentType use null rather than -1 as a flag value.
BUG=
R=rnystrom@google.com

Review URL: https://codereview.chromium.org//196423017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33781 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-17 22:14:21 +00:00
nweiz@google.com e47cf1319c Content-Type header is now stored with a case insensitive key.
Actually, all headers are. Added test that failed before this fix.

BUG=17405
R=nweiz@google.com

Review URL: https://codereview.chromium.org//198423002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33635 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-13 01:36:04 +00:00
nweiz@google.com aee9a542fa Stop working around issue 16029 in pkg/http.
R=rnystrom@google.com

Review URL: https://codereview.chromium.org//137473003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31770 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-14 00:10:48 +00:00
kevmoo@google.com 71d8ab2559 pkg/http: fixed analyzer warnings
R=nweiz@google.com

Review URL: https://codereview.chromium.org//133993009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31726 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-11 01:56:51 +00:00
lrn@google.com a6d4c0b996 Code cleanup (mostly io lib and some http lib).
- Unused function removed,
- Make properties always appear before methods,
- Use dart idioms where possible.

BUG=
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//124753002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31602 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-08 12:03:11 +00:00
nweiz@google.com cbbad67d58 Add stack chain support to pkg/watcher and pkg/http.
R=rnystrom@google.com
BUG=

Review URL: https://codereview.chromium.org//94093007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30912 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-05 19:31:19 +00:00
nweiz@google.com a8a3c2a7f0 Stop working around issue 12780 in pkg/http.
R=rnystrom@google.com
BUG=

Review URL: https://codereview.chromium.org//102973002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30828 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-03 22:05:31 +00:00
nweiz@google.com 9552f94822 Ensure that errors have stack traces attached.
This adds a stack trace argument to all [completeError] and [addError]
calls in pub and associated libraries.

R=rnystrom@google.com
BUG=

Review URL: https://codereview.chromium.org//68493003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30332 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-16 01:19:39 +00:00
nweiz@google.com 557d1d5062 Fix an analyzer error in http and barback.
R=rnystrom@google.com
BUG=

Review URL: https://codereview.chromium.org//62443006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30331 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-16 01:13:04 +00:00
nweiz@google.com d018e7308e Serialize binary barback assets using typed arrays.
R=rnystrom@google.com

Review URL: https://codereview.chromium.org//68103027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30324 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-16 00:09:30 +00:00
nweiz@google.com f4533a552b Add utility methods for sending non-form data in pkg/http.
R=rnystrom@google.com
BUG=8380

Review URL: https://codereview.chromium.org//65583004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30183 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-12 01:59:39 +00:00
ajohnsen@google.com a41a1f597a Fix style in pkg/http.
BUG=
R=whesse@google.com

Review URL: https://codereview.chromium.org//57653002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29791 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-04 07:18:06 +00:00
ajohnsen@google.com b47fc79190 Use BytesBuilder in pkg:http, when accumulating binary data.
This should speed up the library significant.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//47923022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29739 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-01 10:19:01 +00:00
floitsch@google.com 4be547c705 Adapt streams for additional stackTrace argument.
R=lrn@google.com

Review URL: https://codereview.chromium.org//25094002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28511 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-11 12:02:20 +00:00
ajohnsen@google.com 1dba2c2cab Change Uri methods taking a decode argument, to now take an encoding.
This finished the integration of dart:convert into Uri.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//24122002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27426 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-12 11:09:38 +00:00
floitsch@google.com 74da0c7286 Remove usage of dart:json.
R=jmesserly@google.com, lrn@google.com, nweiz@google.com, rnystrom@google.com

Review URL: https://codereview.chromium.org//23596007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26789 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 14:05:11 +00:00
floitsch@google.com 1887b5ca49 Some more removals of dart:utf.
R=jmesserly@google.com, lrn@google.com, nweiz@google.com

Review URL: https://codereview.chromium.org//22909059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26712 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-27 13:18:34 +00:00
nweiz@google.com df5fec68eb Add encoding tests to pkg/http.
These were blocked on issue 6284.

R=rnystrom@google.com
BUG=

Review URL: https://codereview.chromium.org//23450003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26667 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 20:50:27 +00:00
floitsch@google.com 35d7140e66 Remove Encoding-enum from dart:io and add interface in dart:convert.
BUG= http://dartbug.com/6284
BUG= http://dartbug.com/7966
R=nweiz@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//22872012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26632 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 10:37:25 +00:00
kevmoo@j832.com 18d38085ab pkg: analysis aided cleanup
Removed a lot of warnings and hints when opening many pkg projects in the editor

R=gram@google.com

Review URL: https://codereview.chromium.org//22284003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25831 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-06 20:42:04 +00:00
kevmoo@j832.com 5285b80b8a pkg/http tweaks
locking down MultipartRequest a bit
Removed superfluous import of dart:io and dart:isolate

R=nweiz@google.com

Review URL: https://codereview.chromium.org//19866007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25376 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 22:47:13 +00:00
rnystrom@google.com a9d24edd0f Rename "pathos" package to "path".
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//18356011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24964 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 17:54:48 +00:00
ajohnsen@google.com 04b7752d32 Remove references to RedirectLimitExceededException.
BUG=

Review URL: https://codereview.chromium.org//15821013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23851 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 13:45:16 +00:00
nweiz@google.com 526d551cd6 Stop working around issue 2644.
R=rnystrom@google.com

Review URL: https://codereview.chromium.org//16756002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23829 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-10 21:21:15 +00:00
nweiz@google.com ebaa28cfec Make my pkg packages warning-clean.
R=rnystrom@google.com

Review URL: https://codereview.chromium.org//16097013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23620 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-04 23:34:06 +00:00
lrn@google.com faa7227cec Make new StreamController be async by default.
Change all instances, except some tests, to be sync still.
Rename Multiplex to Broadcast everywhere.

R=floitsch@google.com

Review URL: https://codereview.chromium.org//16125005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23453 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 06:07:39 +00:00
sgjesse@google.com bb6d8c6d20 Remove library dart:crypto
Moved the contnet of dart:crypto to the package pkg/crypto.

R=dgrove@google.com, floitsch@google.com, iposva@google.com, nweiz@google.com
BUG=

Review URL: https://codereview.chromium.org//15820008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23322 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 07:29:29 +00:00
sgjesse@google.com 9d6a64e81b Merge the dart:uri library into dart:core and update the Uri class
This merges the dart:uri library into dart:core removing the dart:uri library. Besides moving the library the Url class has been changed.

* Removed existing Uri constructor as it was equivalent with Uri.parse
* Remamed constructor Uri.fromComponents to Uri
* Moved toplevel function encodeUriComponent to static method Uri.encodeComponent
* Moved toplevel function decodeUriComponent to static method Uri.decodeComponent
* Moved toplevel function encodeUri to static method Uri.encodeFull
* Moved toplevel function decodeUri to static method Uri.decodeFull
* Rename domain to host
* Added static methods Uri.encodeQueryComponent and Uri.decodeQueryComponent
* Added support for path generation and splitting
* Added support for query generation and splitting
* Added some level of normalization

R=floitsch@google.com, lrn@google.com, nweiz@google.com, scheglov@google.com
BUG=

Review URL: https://codereview.chromium.org//16019002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23266 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-28 13:35:01 +00:00
nweiz@google.com 47965dd901 Default to UTF-8 in the HTTP package.
This makes ByteStream.toStringStream respect its Encoding properly.
[decodeString] and [encodeString] are still unable to do so (see issue 6284).

BUG=10573
R=rnystrom@google.com

Review URL: https://codereview.chromium.org//14958005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22805 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-16 18:32:56 +00:00
sgjesse@google.com f13b6178e1 Change fromString constructor to parse static method
on HeaderValue and ContentType.

R=ajohnsen@google.com
BUG=

Review URL: https://codereview.chromium.org//14914002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22406 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-06 07:30:02 +00:00
ager@google.com 431954b584 Rename dart:typeddata to dart:typed_data.
R=asiva@google.com, floitsch@google.com, srdjan@google.com
BUG=

Review URL: https://codereview.chromium.org//14426006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21871 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 11:54:54 +00:00
sethladd@google.com 8fd2c2e5ea add installation instructions to pkg packages
BUG=

Review URL: https://codereview.chromium.org//14188048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21770 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-19 20:51:10 +00:00
floitsch@google.com 466d6670c1 Refactor Future constructors.
BUG=

Review URL: https://codereview.chromium.org//14070010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21517 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 21:24:27 +00:00
floitsch@google.com 5431a5af54 Remove AsyncError with Expando.
Review URL: https://codereview.chromium.org//14251006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21498 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 18:58:32 +00:00
ajohnsen@google.com 57161d6e59 Remove deprecated CollectionSink and Stream.pipeInto.
BUG=

Review URL: https://codereview.chromium.org//14051005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21261 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-11 09:31:50 +00:00
ajohnsen@google.com 21451e1d3d Remove HttpClientRequest.response, as it's identical to HttpClientRequest.done.
BUG=

Review URL: https://codereview.chromium.org//14055003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21198 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-10 12:54:23 +00:00
nweiz@google.com 49113955eb Normalize packages' library names.
This makes the library names play nicer with dartdoc.

Review URL: https://codereview.chromium.org//13674024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21106 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-08 19:39:30 +00:00
floitsch@google.com bef8ebb5f6 Add Iterable.fold (and Stream.fold) which replace reduce.
For now this is just a copy. In a next step we will change the behavior of
`reduce`.

BUG= http://dartbug.com/9536

Review URL: https://codereview.chromium.org//13548002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20978 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 16:12:40 +00:00
asiva@google.com 5e3c5d5568 Change http code in pkg to use dart:typeddata instead of dart:scalarlist
Review URL: https://codereview.chromium.org//13138002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20642 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-28 20:51:43 +00:00
nweiz@google.com c590e8ae0c Switch pkg packages, pub, and dartdoc to use package: imports.
This also changes the SDK layout by replacing the "pkg" directory, which
contained the full source of all the packages needed by pub and dartdoc, with a
"packages" directory that contains only their lib directories. This directory is
used as the package root for pub and dartdoc when run from the SDK.

BUG=6745

Review URL: https://codereview.chromium.org//12782016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20640 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-28 20:27:28 +00:00
lrn@google.com bead146749 Renamed StreamSink to EventSink. Renamed signalError to addError.
Review URL: https://codereview.chromium.org//12610006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19683 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-08 11:31:19 +00:00
sgjesse@google.com b6096848b1 Make IOSink implement StringSink
Besides adding the StringSink methods I also added writeBytes and
deprecated both add and addString.

To handle the encoding of strings the IOSike has an encoding
property. This property is mutable in situation when it makes sense to
change encoding of what is written. The exception here is for HTTP
where the encoding is determined from the header and the encoding
cannot be changed.

R=ajohnsen@google.com, ager@google.com, nweiz@google.com

BUG=

Review URL: https://codereview.chromium.org//12504006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19676 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-08 10:06:28 +00:00
sgjesse@google.com ff47888a0d Make instances of HeaderValue and ContentType immutable
Their parameters map is still mutable though.

R=ajohnsen@google.com

BUG=

Review URL: https://codereview.chromium.org//12440002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19598 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-07 07:25:56 +00:00