]>
git.wh0rd.org - tt-rss.git/blob - lib/dojo/request.js.uncompressed.js
1 define("dojo/request", [
2 './request/default!'/*=====,
4 './promise/Promise' =====*/
5 ], function(request
/*=====, declare, Promise =====*/){
7 request = function(url, options){
9 // Send a request using the default transport for the current platform.
11 // The URL to request.
12 // options: dojo/request.__Options?
13 // Options for the request.
14 // returns: dojo/request.__Promise
16 request.__Promise = declare(Promise, {
17 // response: dojo/promise/Promise
18 // A promise resolving to an object representing
19 // the response from the server.
21 request.__BaseOptions = declare(null, {
22 // query: String|Object?
23 // Query parameters to append to the URL.
24 // data: String|Object?
25 // Data to transfer. This is ignored for GET and DELETE
27 // preventCache: Boolean?
28 // Whether to append a cache-busting parameter to the URL.
30 // Milliseconds to wait for the response. If this time
31 // passes, the then the promise is rejected.
33 // How to handle the response from the server. Default is
34 // 'text'. Other values are 'json', 'javascript', and 'xml'.
36 request.__MethodOptions = declare(null, {
38 // The HTTP method to use to make the request. Must be
41 request.__Options = declare([request.__BaseOptions, request.__MethodOptions]);
43 request.get = function(url, options){
45 // Send an HTTP GET request using the default transport for the current platform.
48 // options: dojo/request.__BaseOptions?
49 // Options for the request.
50 // returns: dojo/request.__Promise
52 request.post = function(url, options){
54 // Send an HTTP POST request using the default transport for the current platform.
57 // options: dojo/request.__BaseOptions?
58 // Options for the request.
59 // returns: dojo/request.__Promise
61 request.put = function(url, options){
63 // Send an HTTP POST request using the default transport for the current platform.
66 // options: dojo/request.__BaseOptions?
67 // Options for the request.
68 // returns: dojo/request.__Promise
70 request.del = function(url, options){
72 // Send an HTTP DELETE request using the default transport for the current platform.
75 // options: dojo/request.__BaseOptions?
76 // Options for the request.
77 // returns: dojo/request.__Promise