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

Side by Side Diff: runtime/bin/http.dart

Issue 10533078: Enable standalone/io/http_test, splitting it into three separate tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 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
« no previous file with comments | « no previous file | tests/standalone/io/http_advanced_test.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * HTTP status codes. 6 * HTTP status codes.
7 */ 7 */
8 interface HttpStatus { 8 interface HttpStatus {
9 static final int CONTINUE = 100; 9 static final int CONTINUE = 100;
10 static final int SWITCHING_PROTOCOLS = 101; 10 static final int SWITCHING_PROTOCOLS = 101;
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 /** 710 /**
711 * Sets the handler that gets called if an error occurs while 711 * Sets the handler that gets called if an error occurs while
712 * connecting or processing the HTTP request. 712 * connecting or processing the HTTP request.
713 */ 713 */
714 void set onError(void callback(e)); 714 void set onError(void callback(e));
715 715
716 /** 716 /**
717 * Set this property to [:true:] if this connection should 717 * Set this property to [:true:] if this connection should
718 * automatically follow redirects. The default is [:true:]. 718 * automatically follow redirects. The default is [:true:].
719 */ 719 */
720 bool followRedirect; 720 bool followRedirects;
721 721
722 /** 722 /**
723 * Set this property to the maximum number of redirects to follow 723 * Set this property to the maximum number of redirects to follow
724 * when [followRedirect] is [:true:]. If this number is exceeded the 724 * when [followRedirects] is [:true:]. If this number is exceeded the
725 * [onError] callback will be called with a [RedirectLimitExceeded] 725 * [onError] callback will be called with a [RedirectLimitExceeded]
726 * exception. The default value is 5. 726 * exception. The default value is 5.
727 */ 727 */
728 int maxRedirects; 728 int maxRedirects;
729 729
730 /** 730 /**
731 * Returns the series of redirects this connection has been through. 731 * Returns the series of redirects this connection has been through.
732 */ 732 */
733 List<RedirectInfo> get redirects(); 733 List<RedirectInfo> get redirects();
734 734
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 * Returns the request headers. 768 * Returns the request headers.
769 */ 769 */
770 HttpHeaders get headers(); 770 HttpHeaders get headers();
771 771
772 /** 772 /**
773 * Cookies to present to the server (in the Cookie header). 773 * Cookies to present to the server (in the Cookie header).
774 */ 774 */
775 List<Cookie> get cookies(); 775 List<Cookie> get cookies();
776 776
777 /** 777 /**
778 * Gets and sets the requested persistent connection state.
779 * The default value is [:true:].
780 */
781 bool persistentConnection;
782
783 /**
778 * Returns the output stream for the request. This is used to write 784 * Returns the output stream for the request. This is used to write
779 * the request data. When all request data has been written close 785 * the request data. When all request data has been written close
780 * the stream to indicate the end of the request. 786 * the stream to indicate the end of the request.
781 * 787 *
782 * When this is accessed for the first time the request header is 788 * When this is accessed for the first time the request header is
783 * send. Calling any methods that will change the header after 789 * send. Calling any methods that will change the header after
784 * having retrieved the output stream will throw an exception. 790 * having retrieved the output stream will throw an exception.
785 */ 791 */
786 OutputStream get outputStream(); 792 OutputStream get outputStream();
787 } 793 }
(...skipping 13 matching lines...) Expand all
801 */ 807 */
802 String get reasonPhrase(); 808 String get reasonPhrase();
803 809
804 /** 810 /**
805 * Returns the content length of the request body. If the size of 811 * Returns the content length of the request body. If the size of
806 * the request body is not known in advance this -1. 812 * the request body is not known in advance this -1.
807 */ 813 */
808 int get contentLength(); 814 int get contentLength();
809 815
810 /** 816 /**
817 * Gets the persistent connection state returned by the server.
818 */
819 bool get persistentConnection();
820
821 /**
811 * Returns whether the status code is one of the normal redirect 822 * Returns whether the status code is one of the normal redirect
812 * codes [:HttpStatus.MOVED_PERMANENTLY:], [:HttpStatus.FOUND:], 823 * codes [:HttpStatus.MOVED_PERMANENTLY:], [:HttpStatus.FOUND:],
813 * [:HttpStatus.MOVED_TEMPORARILY:], [:HttpStatus.SEE_OTHER:] and 824 * [:HttpStatus.MOVED_TEMPORARILY:], [:HttpStatus.SEE_OTHER:] and
814 * [:HttpStatus.TEMPORARY_REDIRECT:]. 825 * [:HttpStatus.TEMPORARY_REDIRECT:].
815 */ 826 */
816 bool get isRedirect(); 827 bool get isRedirect();
817 828
818 /** 829 /**
819 * Returns the response headers. 830 * Returns the response headers.
820 */ 831 */
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 class RedirectLimitExceededException extends RedirectException { 895 class RedirectLimitExceededException extends RedirectException {
885 const RedirectLimitExceededException(List<RedirectInfo> redirects) 896 const RedirectLimitExceededException(List<RedirectInfo> redirects)
886 : super("Redirect limit exceeded", redirects); 897 : super("Redirect limit exceeded", redirects);
887 } 898 }
888 899
889 900
890 class RedirectLoopException extends RedirectException { 901 class RedirectLoopException extends RedirectException {
891 const RedirectLoopException(List<RedirectInfo> redirects) 902 const RedirectLoopException(List<RedirectInfo> redirects)
892 : super("Redirect loop detected", redirects); 903 : super("Redirect loop detected", redirects);
893 } 904 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/io/http_advanced_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698