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

Unified Diff: sdk/lib/io/http.dart

Issue 225323005: Update HTTP documentation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http.dart
diff --git a/sdk/lib/io/http.dart b/sdk/lib/io/http.dart
index dee31ab2b26e0f13f1bf9429ea7b6d132aae80ed..eb6032766594075834d2b8bbfeef6b5d6a3aceea 100644
--- a/sdk/lib/io/http.dart
+++ b/sdk/lib/io/http.dart
@@ -924,6 +924,8 @@ abstract class HttpRequest implements Stream<List<int>> {
/**
* The request headers.
+ *
+ * The request headers are immutable.
Anders Johnsen 2014/04/04 12:56:40 This looks like half a copy of the above line. Con
Søren Gjesse 2014/04/04 13:06:14 Done.
*/
HttpHeaders get headers;
@@ -1044,12 +1046,20 @@ abstract class HttpResponse implements IOSink {
* the official HTTP status codes use the fields from
* [HttpStatus]. If no status code is explicitly set the default
* value [HttpStatus.OK] is used.
+ *
+ * The status code must be set before the body is written
+ * to. Setting the status code after writing to the body will throw
Anders Johnsen 2014/04/04 12:56:40 or closed.
Søren Gjesse 2014/04/04 13:06:14 Done.
+ * a `StateError`.
*/
int statusCode;
/**
* Gets and sets the reason phrase. If no reason phrase is explicitly
* set a default reason phrase is provided.
+ *
+ * The reason phrase must be set before the body is written
+ * to. Setting the reason phrase after writing to the body will throw
Anders Johnsen 2014/04/04 12:56:40 ditto.
Søren Gjesse 2014/04/04 13:06:14 Done.
+ * a `StateError`.
*/
String reasonPhrase;
@@ -1074,6 +1084,9 @@ abstract class HttpResponse implements IOSink {
/**
* Returns the response headers.
+ *
+ * The response headers can be modified until the body is written
+ * to. After that they become immutable.
Anders Johnsen 2014/04/04 12:56:40 ditto.
Søren Gjesse 2014/04/04 13:06:14 Done.
*/
HttpHeaders get headers;
@@ -1551,7 +1564,10 @@ abstract class HttpClientRequest implements IOSink {
int contentLength;
/**
- * Returns the request headers.
+ * Returns the client request headers.
+ *
+ * The client request headers can be modified until the body is
Anders Johnsen 2014/04/04 12:56:40 ditto, and below
Søren Gjesse 2014/04/04 13:06:14 Done.
+ * written to. After that they become immutable.
*/
HttpHeaders get headers;
@@ -1598,22 +1614,38 @@ abstract class HttpClientRequest implements IOSink {
abstract class HttpClientResponse implements Stream<List<int>> {
/**
* Returns the status code.
+ *
+ * The status code must be set before the body is written
+ * to. Setting the status code after writing to the body will throw
+ * a `StateError`.
*/
int get statusCode;
/**
* Returns the reason phrase associated with the status code.
+ *
+ * The reason phrase must be set before the body is written
+ * to. Setting the reason phrase after writing to the body will throw
+ * a `StateError`.
*/
String get reasonPhrase;
/**
* Returns the content length of the response body. Returns -1 if the size of
* the response body is not known in advance.
+ *
+ * If the content length needs to be set, it must be set before the
+ * body is written to. Setting the reason phrase after writing to
+ * the body will throw a `StateError`.
*/
int get contentLength;
/**
* Gets the persistent connection state returned by the server.
+ *
+ * if the persistent connection state needs to be set, it must be
+ * set before the body is written to. Setting the reason phrase
+ * after writing to the body will throw a `StateError`.
*/
bool get persistentConnection;
@@ -1654,7 +1686,9 @@ abstract class HttpClientResponse implements Stream<List<int>> {
/**
- * Returns the response headers.
+ * Returns the client response headers.
+ *
+ * The client response headers are immutable.
*/
HttpHeaders get headers;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698