Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(806)

Unified Diff: runtime/bin/http.dart

Issue 9625008: Add support for using an URL for establishing HTTP connections (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed rewiev comments from @ager Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/http_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/http.dart
diff --git a/runtime/bin/http.dart b/runtime/bin/http.dart
index 8a5097acceaf9c74db8da4be6934dd3378a029d5..b16181f724da0dd1fbd4990f877cf3afd1e36775 100644
--- a/runtime/bin/http.dart
+++ b/runtime/bin/http.dart
@@ -235,16 +235,37 @@ interface HttpClient default _HttpClient {
HttpClientConnection open(String method, String host, int port, String path);
/**
+ * Opens a HTTP connection. The returned [HttpClientConnection] is
+ * used to register callbacks for asynchronous events on the HTTP
+ * connection. The "Host" header for the request will be set based
+ * the host and port specified in [url]. This can be overridden
+ * through the HttpClientRequest interface before the request is
+ * sent. NOTE if the host is specified as an IP address this will
+ * still be set in the "Host" header.
+ */
+ HttpClientConnection openUrl(String method, Uri url);
+
+ /**
* Opens a HTTP connection using the GET method. See [open] for details.
*/
HttpClientConnection get(String host, int port, String path);
/**
+ * Opens a HTTP connection using the GET method. See [openUrl] for details.
+ */
+ HttpClientConnection getUrl(Uri url);
+
+ /**
* Opens a HTTP connection using the POST method. See [open] for details.
*/
HttpClientConnection post(String host, int port, String path);
/**
+ * Opens a HTTP connection using the POST method. See [openUrl] for details.
+ */
+ HttpClientConnection postUrl(Uri url);
+
+ /**
* Shutdown the HTTP client releasing all resources.
*/
void shutdown();
« no previous file with comments | « no previous file | runtime/bin/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698