OLD | NEW |
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 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 /** | 1310 /** |
1311 * Opens a HTTP connection using the POST method. | 1311 * Opens a HTTP connection using the POST method. |
1312 * | 1312 * |
1313 * The URL to use is specified in [url]. | 1313 * The URL to use is specified in [url]. |
1314 * | 1314 * |
1315 * See [openUrl] for details. | 1315 * See [openUrl] for details. |
1316 */ | 1316 */ |
1317 Future<HttpClientRequest> postUrl(Uri url); | 1317 Future<HttpClientRequest> postUrl(Uri url); |
1318 | 1318 |
1319 /** | 1319 /** |
| 1320 * Opens a HTTP connection using the PUT method. |
| 1321 * |
| 1322 * The server is specified using [host] and [port], and the path |
| 1323 * (including possible fragment and query) is specified using |
| 1324 * [path]. |
| 1325 * |
| 1326 * See [open] for details. |
| 1327 */ |
| 1328 Future<HttpClientRequest> put(String host, int port, String path); |
| 1329 |
| 1330 /** |
| 1331 * Opens a HTTP connection using the PUT method. |
| 1332 * |
| 1333 * The URL to use is specified in [url]. |
| 1334 * |
| 1335 * See [openUrl] for details. |
| 1336 */ |
| 1337 Future<HttpClientRequest> putUrl(Uri url); |
| 1338 |
| 1339 /** |
| 1340 * Opens a HTTP connection using the DELETE method. |
| 1341 * |
| 1342 * The server is specified using [host] and [port], and the path |
| 1343 * (including possible fragment and query) is specified using |
| 1344 * [path]. |
| 1345 * |
| 1346 * See [open] for details. |
| 1347 */ |
| 1348 Future<HttpClientRequest> delete(String host, int port, String path); |
| 1349 |
| 1350 /** |
| 1351 * Opens a HTTP connection using the DELETE method. |
| 1352 * |
| 1353 * The URL to use is specified in [url]. |
| 1354 * |
| 1355 * See [openUrl] for details. |
| 1356 */ |
| 1357 Future<HttpClientRequest> deleteUrl(Uri url); |
| 1358 |
| 1359 /** |
| 1360 * Opens a HTTP connection using the PATCH method. |
| 1361 * |
| 1362 * The server is specified using [host] and [port], and the path |
| 1363 * (including possible fragment and query) is specified using |
| 1364 * [path]. |
| 1365 * |
| 1366 * See [open] for details. |
| 1367 */ |
| 1368 Future<HttpClientRequest> patch(String host, int port, String path); |
| 1369 |
| 1370 /** |
| 1371 * Opens a HTTP connection using the PATCH method. |
| 1372 * |
| 1373 * The URL to use is specified in [url]. |
| 1374 * |
| 1375 * See [openUrl] for details. |
| 1376 */ |
| 1377 Future<HttpClientRequest> patchUrl(Uri url); |
| 1378 |
| 1379 /** |
| 1380 * Opens a HTTP connection using the HEAD method. |
| 1381 * |
| 1382 * The server is specified using [host] and [port], and the path |
| 1383 * (including possible fragment and query) is specified using |
| 1384 * [path]. |
| 1385 * |
| 1386 * See [open] for details. |
| 1387 */ |
| 1388 Future<HttpClientRequest> head(String host, int port, String path); |
| 1389 |
| 1390 /** |
| 1391 * Opens a HTTP connection using the HEAD method. |
| 1392 * |
| 1393 * The URL to use is specified in [url]. |
| 1394 * |
| 1395 * See [openUrl] for details. |
| 1396 */ |
| 1397 Future<HttpClientRequest> headUrl(Uri url); |
| 1398 |
| 1399 /** |
1320 * Sets the function to be called when a site is requesting | 1400 * Sets the function to be called when a site is requesting |
1321 * authentication. The URL requested and the security realm from the | 1401 * authentication. The URL requested and the security realm from the |
1322 * server are passed in the arguments [url] and [realm]. | 1402 * server are passed in the arguments [url] and [realm]. |
1323 * | 1403 * |
1324 * The function returns a [Future] which should complete when the | 1404 * The function returns a [Future] which should complete when the |
1325 * authentication has been resolved. If credentials cannot be | 1405 * authentication has been resolved. If credentials cannot be |
1326 * provided the [Future] should complete with [:false:]. If | 1406 * provided the [Future] should complete with [:false:]. If |
1327 * credentials are available the function should add these using | 1407 * credentials are available the function should add these using |
1328 * [addCredentials] before completing the [Future] with the value | 1408 * [addCredentials] before completing the [Future] with the value |
1329 * [:true:]. | 1409 * [:true:]. |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1833 class RedirectException implements HttpException { | 1913 class RedirectException implements HttpException { |
1834 final String message; | 1914 final String message; |
1835 final List<RedirectInfo> redirects; | 1915 final List<RedirectInfo> redirects; |
1836 | 1916 |
1837 const RedirectException(this.message, this.redirects); | 1917 const RedirectException(this.message, this.redirects); |
1838 | 1918 |
1839 String toString() => "RedirectException: $message"; | 1919 String toString() => "RedirectException: $message"; |
1840 | 1920 |
1841 Uri get uri => redirects.last.location; | 1921 Uri get uri => redirects.last.location; |
1842 } | 1922 } |
OLD | NEW |