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

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: 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 version of the [:HttpServer:]. The string will be set as
Søren Gjesse 2013/06/11 11:02:00 Change Set and get the version of the [:HttpSer
Anders Johnsen 2013/06/11 11:37:55 Done.
177 * the [:Server:] header field for all [HttpResponse]s.
Søren Gjesse 2013/06/11 11:02:00 You can use ` ` instead of [: :].
Anders Johnsen 2013/06/11 11:37:55 Done.
178 *
179 * If the version is set to [:null:]. the field won't be set.
Søren Gjesse 2013/06/11 11:02:00 the field won't be set -> no default `Server` head
Anders Johnsen 2013/06/11 11:37:55 Done.
180 */
181 String version;
Søren Gjesse 2013/06/11 11:02:00 This should be called serverHeader (or maybe even
Anders Johnsen 2013/06/11 11:37:55 Done.
174 } 182 }
175 183
176 184
177 /** 185 /**
178 * Summary statistics about an [HttpServer]s current socket connections. 186 * Summary statistics about an [HttpServer]s current socket connections.
179 */ 187 */
180 class HttpConnectionsInfo { 188 class HttpConnectionsInfo {
181 /** 189 /**
182 * Total number of socket connections. 190 * Total number of socket connections.
183 */ 191 */
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 abstract class HttpClient { 880 abstract class HttpClient {
873 static const int DEFAULT_HTTP_PORT = 80; 881 static const int DEFAULT_HTTP_PORT = 80;
874 static const int DEFAULT_HTTPS_PORT = 443; 882 static const int DEFAULT_HTTPS_PORT = 443;
875 883
876 /** 884 /**
877 * Get and set the idle timeout of non-active persistent (keep-alive) 885 * Get and set the idle timeout of non-active persistent (keep-alive)
878 * connections. The default value is 15 seconds. 886 * connections. The default value is 15 seconds.
879 */ 887 */
880 Duration idleTimeout; 888 Duration idleTimeout;
881 889
890 /**
891 * Set and get the user agent of the [:HttpClient:]. The string will be set as
892 * the [:User-Agent:] header field for all [HttpClientRequest]s.
893 *
894 * If the version is set to [:null:]. the field won't be set.
895 */
896 String userAgent;
897
882 factory HttpClient() => new _HttpClient(); 898 factory HttpClient() => new _HttpClient();
883 899
884 /** 900 /**
885 * Opens a HTTP connection. The returned [HttpClientRequest] is used to 901 * 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 902 * 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 903 * the request will be set to the value [host]:[port]. This can be overridden
888 * through the [HttpClientRequest] interface before the request is sent. 904 * 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' 905 * NOTE if [host] is an IP address this will still be set in the 'host'
890 * header. 906 * header.
891 */ 907 */
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 class RedirectLimitExceededException extends RedirectException { 1386 class RedirectLimitExceededException extends RedirectException {
1371 const RedirectLimitExceededException(List<RedirectInfo> redirects) 1387 const RedirectLimitExceededException(List<RedirectInfo> redirects)
1372 : super("Redirect limit exceeded", redirects); 1388 : super("Redirect limit exceeded", redirects);
1373 } 1389 }
1374 1390
1375 1391
1376 class RedirectLoopException extends RedirectException { 1392 class RedirectLoopException extends RedirectException {
1377 const RedirectLoopException(List<RedirectInfo> redirects) 1393 const RedirectLoopException(List<RedirectInfo> redirects)
1378 : super("Redirect loop detected", redirects); 1394 : super("Redirect loop detected", redirects);
1379 } 1395 }
OLDNEW
« no previous file with comments | « runtime/bin/io_natives.cc ('k') | sdk/lib/io/http_impl.dart » ('j') | sdk/lib/io/options.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698