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

Side by Side Diff: sdk/lib/io/http.dart

Issue 16758008: Add 'Server' and 'User-Agent' default header fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clean up comments and field name. Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * HTTP status codes. 8 * HTTP status codes.
9 */ 9 */
10 abstract class HttpStatus { 10 abstract class HttpStatus {
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 * Sets the timeout, in seconds, for sessions of this [HttpServer]. 164 * Sets the timeout, in seconds, for sessions of this [HttpServer].
165 * The default timeout is 20 minutes. 165 * The default timeout is 20 minutes.
166 */ 166 */
167 set sessionTimeout(int timeout); 167 set sessionTimeout(int timeout);
168 168
169 /** 169 /**
170 * Returns an [HttpConnectionsInfo] object summarizing the number of 170 * Returns an [HttpConnectionsInfo] object summarizing the number of
171 * current connections handled by the server. 171 * current connections handled by the server.
172 */ 172 */
173 HttpConnectionsInfo connectionsInfo(); 173 HttpConnectionsInfo connectionsInfo();
174
175 /**
176 * Set and get the default value of the `Server` header for all responses
177 * generated by this [HttpServer]. The default value is
178 * `Dart/<version> (dart:io)`.
179 *
180 * If the version is set to `null`, no default `Server` header will be added
Søren Gjesse 2013/06/11 11:48:37 the version -> [serverHeader].
Anders Johnsen 2013/06/11 11:54:09 Done.
181 * to each response.
182 */
183 String serverHeader;
174 } 184 }
175 185
176 186
177 /** 187 /**
178 * Summary statistics about an [HttpServer]s current socket connections. 188 * Summary statistics about an [HttpServer]s current socket connections.
179 */ 189 */
180 class HttpConnectionsInfo { 190 class HttpConnectionsInfo {
181 /** 191 /**
182 * Total number of socket connections. 192 * Total number of socket connections.
183 */ 193 */
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 abstract class HttpClient { 882 abstract class HttpClient {
873 static const int DEFAULT_HTTP_PORT = 80; 883 static const int DEFAULT_HTTP_PORT = 80;
874 static const int DEFAULT_HTTPS_PORT = 443; 884 static const int DEFAULT_HTTPS_PORT = 443;
875 885
876 /** 886 /**
877 * Get and set the idle timeout of non-active persistent (keep-alive) 887 * Get and set the idle timeout of non-active persistent (keep-alive)
878 * connections. The default value is 15 seconds. 888 * connections. The default value is 15 seconds.
879 */ 889 */
880 Duration idleTimeout; 890 Duration idleTimeout;
881 891
892 /**
893 * Set and get the default value of the `User-Agent` header for all requests
894 * generated by this [HttpClient]. The default value is
895 * `Dart/<version> (dart:io)`.
896 *
897 * If the version is set to `null`, no default `User-Agent` header will be
Søren Gjesse 2013/06/11 11:48:37 the version -> [userAgent].
Anders Johnsen 2013/06/11 11:54:09 Done.
898 * added to each request.
899 */
900 String userAgent;
901
882 factory HttpClient() => new _HttpClient(); 902 factory HttpClient() => new _HttpClient();
883 903
884 /** 904 /**
885 * Opens a HTTP connection. The returned [HttpClientRequest] is used to 905 * Opens a HTTP connection. The returned [HttpClientRequest] is used to
886 * fill in the content of the request before sending it. The 'host' header for 906 * fill in the content of the request before sending it. The 'host' header for
887 * the request will be set to the value [host]:[port]. This can be overridden 907 * the request will be set to the value [host]:[port]. This can be overridden
888 * through the [HttpClientRequest] interface before the request is sent. 908 * through the [HttpClientRequest] interface before the request is sent.
889 * NOTE if [host] is an IP address this will still be set in the 'host' 909 * NOTE if [host] is an IP address this will still be set in the 'host'
890 * header. 910 * header.
891 */ 911 */
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 class RedirectLimitExceededException extends RedirectException { 1390 class RedirectLimitExceededException extends RedirectException {
1371 const RedirectLimitExceededException(List<RedirectInfo> redirects) 1391 const RedirectLimitExceededException(List<RedirectInfo> redirects)
1372 : super("Redirect limit exceeded", redirects); 1392 : super("Redirect limit exceeded", redirects);
1373 } 1393 }
1374 1394
1375 1395
1376 class RedirectLoopException extends RedirectException { 1396 class RedirectLoopException extends RedirectException {
1377 const RedirectLoopException(List<RedirectInfo> redirects) 1397 const RedirectLoopException(List<RedirectInfo> redirects)
1378 : super("Redirect loop detected", redirects); 1398 : super("Redirect loop detected", redirects);
1379 } 1399 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698