OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
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. | |
4 | |
5 // WARNING: | |
6 // This file contains documentation that is merged into the real source. | |
7 // Do not make code changes here. | |
8 | |
9 /** | |
10 * HttpRequest is Dart's name for the XMLHttpRequest object, as described below. | |
11 */ | |
12 | |
13 /// @domName XMLHttpRequest | |
14 abstract class HttpRequest implements EventTarget { | |
15 factory HttpRequest.get(String url, onSuccess(HttpRequest request)) => | |
16 _HttpRequestFactoryProvider.createHttpRequest_get(url, onSuccess); | |
17 | |
18 factory HttpRequest.getWithCredentials(String url, onSuccess(HttpRequest reque
st)) => | |
19 _HttpRequestFactoryProvider.createHttpRequestgetWithCredentials(url, onSuc
cess); | |
20 | |
21 factory HttpRequest() => _HttpRequestFactoryProvider.createHttpRequest(); | |
22 | |
23 /** | |
24 * @domName EventTarget.addEventListener, EventTarget.removeEventListener, Eve
ntTarget.dispatchEvent | |
25 */ | |
26 HttpRequestEvents get on; | |
27 | |
28 static const int DONE = 4; | |
29 | |
30 static const int HEADERS_RECEIVED = 2; | |
31 | |
32 static const int LOADING = 3; | |
33 | |
34 static const int OPENED = 1; | |
35 | |
36 static const int UNSENT = 0; | |
37 | |
38 /** @domName XMLHttpRequest.readyState */ | |
39 abstract int get readyState; | |
40 | |
41 /** @domName XMLHttpRequest.response */ | |
42 abstract Object get response; | |
43 | |
44 /** @domName XMLHttpRequest.responseText */ | |
45 abstract String get responseText; | |
46 | |
47 /** @domName XMLHttpRequest.responseType */ | |
48 String responseType; | |
49 | |
50 /** @domName XMLHttpRequest.responseXML */ | |
51 abstract Document get responseXML; | |
52 | |
53 /** @domName XMLHttpRequest.status */ | |
54 abstract int get status; | |
55 | |
56 /** @domName XMLHttpRequest.statusText */ | |
57 abstract String get statusText; | |
58 | |
59 /** @domName XMLHttpRequest.upload */ | |
60 abstract HttpRequestUpload get upload; | |
61 | |
62 /** @domName XMLHttpRequest.withCredentials */ | |
63 bool withCredentials; | |
64 | |
65 /** @domName XMLHttpRequest.abort */ | |
66 void abort(); | |
67 | |
68 /** @domName XMLHttpRequest.addEventListener */ | |
69 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]); | |
70 | |
71 /** @domName XMLHttpRequest.dispatchEvent */ | |
72 bool $dom_dispatchEvent(Event evt); | |
73 | |
74 /** @domName XMLHttpRequest.getAllResponseHeaders */ | |
75 String getAllResponseHeaders(); | |
76 | |
77 /** @domName XMLHttpRequest.getResponseHeader */ | |
78 String getResponseHeader(String header); | |
79 | |
80 /** @domName XMLHttpRequest.open */ | |
81 void open(String method, String url, [bool async, String user, String password
]); | |
82 | |
83 /** @domName XMLHttpRequest.overrideMimeType */ | |
84 void overrideMimeType(String override); | |
85 | |
86 /** @domName XMLHttpRequest.removeEventListener */ | |
87 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]); | |
88 | |
89 /** @domName XMLHttpRequest.send */ | |
90 void send([data]); | |
91 | |
92 /** @domName XMLHttpRequest.setRequestHeader */ | |
93 void setRequestHeader(String header, String value); | |
94 } | |
95 | |
96 abstract class HttpRequestEvents implements Events { | |
97 | |
98 EventListenerList get abort; | |
99 | |
100 EventListenerList get error; | |
101 | |
102 EventListenerList get load; | |
103 | |
104 EventListenerList get loadEnd; | |
105 | |
106 EventListenerList get loadStart; | |
107 | |
108 EventListenerList get progress; | |
109 | |
110 EventListenerList get readyStateChange; | |
111 } | |
OLD | NEW |