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

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

Issue 140783013: use proper notation for true, false, and null in doc comments (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: long line Created 6 years, 11 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
« no previous file with comments | « sdk/lib/io/data_transformer.dart ('k') | sdk/lib/io/socket.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 839
840 /** 840 /**
841 * The HTTP protocol version used in the request, 841 * The HTTP protocol version used in the request,
842 * either "1.0" or "1.1" (read-only). 842 * either "1.0" or "1.1" (read-only).
843 */ 843 */
844 String get protocolVersion; 844 String get protocolVersion;
845 845
846 /** 846 /**
847 * Information about the client connection (read-only). 847 * Information about the client connection (read-only).
848 * 848 *
849 * Returns [null] if the socket is not available. 849 * Returns [:null:] if the socket is not available.
850 */ 850 */
851 HttpConnectionInfo get connectionInfo; 851 HttpConnectionInfo get connectionInfo;
852 852
853 /** 853 /**
854 * The [HttpResponse] object, used for sending back the response to the 854 * The [HttpResponse] object, used for sending back the response to the
855 * client (read-only). 855 * client (read-only).
856 * 856 *
857 * If the [contentLength] of the body isn't 0, and the body isn't being read, 857 * If the [contentLength] of the body isn't 0, and the body isn't being read,
858 * any write calls on the [HttpResponse] automatically drain the request 858 * any write calls on the [HttpResponse] automatically drain the request
859 * body. 859 * body.
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 * Detaches the underlying socket from the HTTP server. When the 963 * Detaches the underlying socket from the HTTP server. When the
964 * socket is detached the HTTP server will no longer perform any 964 * socket is detached the HTTP server will no longer perform any
965 * operations on it. 965 * operations on it.
966 * 966 *
967 * This is normally used when a HTTP upgrade request is received 967 * This is normally used when a HTTP upgrade request is received
968 * and the communication should continue with a different protocol. 968 * and the communication should continue with a different protocol.
969 */ 969 */
970 Future<Socket> detachSocket(); 970 Future<Socket> detachSocket();
971 971
972 /** 972 /**
973 * Gets information about the client connection. Returns [null] if the socket 973 * Gets information about the client connection. Returns [:null:] if the
974 * is not available. 974 * socket is not available.
975 */ 975 */
976 HttpConnectionInfo get connectionInfo; 976 HttpConnectionInfo get connectionInfo;
977 } 977 }
978 978
979 979
980 /** 980 /**
981 * A client that receives content, such as web pages, from 981 * A client that receives content, such as web pages, from
982 * a server using the HTTP protocol. 982 * a server using the HTTP protocol.
983 * 983 *
984 * HttpClient contains a number of methods to send a HTTP request 984 * HttpClient contains a number of methods to send a HTTP request
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 */ 1139 */
1140 Future<HttpClientRequest> postUrl(Uri url); 1140 Future<HttpClientRequest> postUrl(Uri url);
1141 1141
1142 /** 1142 /**
1143 * Sets the function to be called when a site is requesting 1143 * Sets the function to be called when a site is requesting
1144 * authentication. The URL requested and the security realm from the 1144 * authentication. The URL requested and the security realm from the
1145 * server are passed in the arguments [url] and [realm]. 1145 * server are passed in the arguments [url] and [realm].
1146 * 1146 *
1147 * The function returns a [Future] which should complete when the 1147 * The function returns a [Future] which should complete when the
1148 * authentication has been resolved. If credentials cannot be 1148 * authentication has been resolved. If credentials cannot be
1149 * provided the [Future] should complete with [false]. If 1149 * provided the [Future] should complete with [:false:]. If
1150 * credentials are available the function should add these using 1150 * credentials are available the function should add these using
1151 * [addCredentials] before completing the [Future] with the value 1151 * [addCredentials] before completing the [Future] with the value
1152 * [true]. 1152 * [:true:].
1153 * 1153 *
1154 * If the [Future] completes with true the request will be retried 1154 * If the [Future] completes with true the request will be retried
1155 * using the updated credentials. Otherwise response processing will 1155 * using the updated credentials. Otherwise response processing will
1156 * continue normally. 1156 * continue normally.
1157 */ 1157 */
1158 set authenticate(Future<bool> f(Uri url, String scheme, String realm)); 1158 set authenticate(Future<bool> f(Uri url, String scheme, String realm));
1159 1159
1160 /** 1160 /**
1161 * Add credentials to be used for authorizing HTTP requests. 1161 * Add credentials to be used for authorizing HTTP requests.
1162 */ 1162 */
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 } 1246 }
1247 1247
1248 /** 1248 /**
1249 * Sets the function to be called when a proxy is requesting 1249 * Sets the function to be called when a proxy is requesting
1250 * authentication. Information on the proxy in use and the security 1250 * authentication. Information on the proxy in use and the security
1251 * realm for the authentication are passed in the arguments [host], 1251 * realm for the authentication are passed in the arguments [host],
1252 * [port] and [realm]. 1252 * [port] and [realm].
1253 * 1253 *
1254 * The function returns a [Future] which should complete when the 1254 * The function returns a [Future] which should complete when the
1255 * authentication has been resolved. If credentials cannot be 1255 * authentication has been resolved. If credentials cannot be
1256 * provided the [Future] should complete with [false]. If 1256 * provided the [Future] should complete with [:false:]. If
1257 * credentials are available the function should add these using 1257 * credentials are available the function should add these using
1258 * [addProxyCredentials] before completing the [Future] with the value 1258 * [addProxyCredentials] before completing the [Future] with the value
1259 * [true]. 1259 * [:true:].
1260 * 1260 *
1261 * If the [Future] completes with [true] the request will be retried 1261 * If the [Future] completes with [:true:] the request will be retried
1262 * using the updated credentials. Otherwise response processing will 1262 * using the updated credentials. Otherwise response processing will
1263 * continue normally. 1263 * continue normally.
1264 */ 1264 */
1265 set authenticateProxy( 1265 set authenticateProxy(
1266 Future<bool> f(String host, int port, String scheme, String realm)); 1266 Future<bool> f(String host, int port, String scheme, String realm));
1267 1267
1268 /** 1268 /**
1269 * Add credentials to be used for authorizing HTTP proxies. 1269 * Add credentials to be used for authorizing HTTP proxies.
1270 */ 1270 */
1271 void addProxyCredentials(String host, 1271 void addProxyCredentials(String host,
1272 int port, 1272 int port,
1273 String realm, 1273 String realm,
1274 HttpClientCredentials credentials); 1274 HttpClientCredentials credentials);
1275 1275
1276 /** 1276 /**
1277 * Sets a callback that will decide whether to accept a secure connection 1277 * Sets a callback that will decide whether to accept a secure connection
1278 * with a server certificate that cannot be authenticated by any of our 1278 * with a server certificate that cannot be authenticated by any of our
1279 * trusted root certificates. 1279 * trusted root certificates.
1280 * 1280 *
1281 * When an secure HTTP request if made, using this HttpClient, and the 1281 * When an secure HTTP request if made, using this HttpClient, and the
1282 * server returns a server certificate that cannot be authenticated, the 1282 * server returns a server certificate that cannot be authenticated, the
1283 * callback is called asynchronously with the [X509Certificate] object and 1283 * callback is called asynchronously with the [X509Certificate] object and
1284 * the server's hostname and port. If the value of [badCertificateCallback] 1284 * the server's hostname and port. If the value of [badCertificateCallback]
1285 * is [null], the bad certificate is rejected, as if the callback 1285 * is [:null:], the bad certificate is rejected, as if the callback
1286 * returned [false] 1286 * returned [:false:]
1287 * 1287 *
1288 * If the callback returns true, the secure connection is accepted and the 1288 * If the callback returns true, the secure connection is accepted and the
1289 * [:Future<HttpClientRequest>:] that was returned from the call making the 1289 * [:Future<HttpClientRequest>:] that was returned from the call making the
1290 * request completes with a valid HttpRequest object. If the callback returns 1290 * request completes with a valid HttpRequest object. If the callback returns
1291 * false, the [:Future<HttpClientRequest>:] completes with an exception. 1291 * false, the [:Future<HttpClientRequest>:] completes with an exception.
1292 * 1292 *
1293 * If a bad certificate is received on a connection attempt, the library calls 1293 * If a bad certificate is received on a connection attempt, the library calls
1294 * the function that was the value of badCertificateCallback at the time 1294 * the function that was the value of badCertificateCallback at the time
1295 * the the request is made, even if the value of badCertificateCallback 1295 * the the request is made, even if the value of badCertificateCallback
1296 * has changed since then. 1296 * has changed since then.
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 * future will complete with an error. 1411 * future will complete with an error.
1412 */ 1412 */
1413 Future<HttpClientResponse> get done; 1413 Future<HttpClientResponse> get done;
1414 1414
1415 /** 1415 /**
1416 * Close the request for input. Returns the value of [done]. 1416 * Close the request for input. Returns the value of [done].
1417 */ 1417 */
1418 Future<HttpClientResponse> close(); 1418 Future<HttpClientResponse> close();
1419 1419
1420 /** 1420 /**
1421 * Get information about the client connection. Returns [null] if the socket 1421 * Get information about the client connection. Returns [:null:] if the socket
1422 * is not available. 1422 * is not available.
1423 */ 1423 */
1424 HttpConnectionInfo get connectionInfo; 1424 HttpConnectionInfo get connectionInfo;
1425 } 1425 }
1426 1426
1427 1427
1428 /** 1428 /**
1429 * HTTP response for a client connection. The [HttpClientResponse] is a 1429 * HTTP response for a client connection. The [HttpClientResponse] is a
1430 * [Stream] of the body content of the response. Listen to the body to handle 1430 * [Stream] of the body content of the response. Listen to the body to handle
1431 * the data and be notified once the entire body is received. 1431 * the data and be notified once the entire body is received.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1471 * Redirects this connection to a new URL. The default value for 1471 * Redirects this connection to a new URL. The default value for
1472 * [method] is the method for the current request. The default value 1472 * [method] is the method for the current request. The default value
1473 * for [url] is the value of the [HttpHeaders.LOCATION] header of 1473 * for [url] is the value of the [HttpHeaders.LOCATION] header of
1474 * the current response. All body data must have been read from the 1474 * the current response. All body data must have been read from the
1475 * current response before calling [redirect]. 1475 * current response before calling [redirect].
1476 * 1476 *
1477 * All headers added to the request will be added to the redirection 1477 * All headers added to the request will be added to the redirection
1478 * request. However, any body sent with the request will not be 1478 * request. However, any body sent with the request will not be
1479 * part of the redirection request. 1479 * part of the redirection request.
1480 * 1480 *
1481 * If [followLoops] is set to [true], redirect will follow the redirect, 1481 * If [followLoops] is set to [:true:], redirect will follow the redirect,
1482 * even if the URL was already visited. The default value is [false]. 1482 * even if the URL was already visited. The default value is [:false:].
1483 * 1483 *
1484 * [redirect] will ignore [maxRedirects] and will always perform the redirect. 1484 * [redirect] will ignore [maxRedirects] and will always perform the redirect.
1485 */ 1485 */
1486 Future<HttpClientResponse> redirect([String method, 1486 Future<HttpClientResponse> redirect([String method,
1487 Uri url, 1487 Uri url,
1488 bool followLoops]); 1488 bool followLoops]);
1489 1489
1490 1490
1491 /** 1491 /**
1492 * Returns the response headers. 1492 * Returns the response headers.
(...skipping 15 matching lines...) Expand all
1508 */ 1508 */
1509 List<Cookie> get cookies; 1509 List<Cookie> get cookies;
1510 1510
1511 /** 1511 /**
1512 * Returns the certificate of the HTTPS server providing the response. 1512 * Returns the certificate of the HTTPS server providing the response.
1513 * Returns null if the connection is not a secure TLS or SSL connection. 1513 * Returns null if the connection is not a secure TLS or SSL connection.
1514 */ 1514 */
1515 X509Certificate get certificate; 1515 X509Certificate get certificate;
1516 1516
1517 /** 1517 /**
1518 * Gets information about the client connection. Returns [null] if the socket 1518 * Gets information about the client connection. Returns [:null:] if the socke t
1519 * is not available. 1519 * is not available.
1520 */ 1520 */
1521 HttpConnectionInfo get connectionInfo; 1521 HttpConnectionInfo get connectionInfo;
1522 } 1522 }
1523 1523
1524 1524
1525 abstract class HttpClientCredentials { } 1525 abstract class HttpClientCredentials { }
1526 1526
1527 1527
1528 /** 1528 /**
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 class RedirectException implements HttpException { 1612 class RedirectException implements HttpException {
1613 final String message; 1613 final String message;
1614 final List<RedirectInfo> redirects; 1614 final List<RedirectInfo> redirects;
1615 1615
1616 const RedirectException(this.message, this.redirects); 1616 const RedirectException(this.message, this.redirects);
1617 1617
1618 String toString() => "RedirectException: $message"; 1618 String toString() => "RedirectException: $message";
1619 1619
1620 Uri get uri => redirects.last.location; 1620 Uri get uri => redirects.last.location;
1621 } 1621 }
OLDNEW
« no previous file with comments | « sdk/lib/io/data_transformer.dart ('k') | sdk/lib/io/socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698