Home | History | Annotate | Download | only in webapp

Lines Matching defs:xhr

15 /** Namespace for XHR functions */
17 remoting.xhr = remoting.xhr || {};
25 remoting.xhr.urlencodeParamHash = function(paramHash) {
38 * Execute an XHR GET asynchronously.
49 * XHR.
52 remoting.xhr.get = function(url, onDone, opt_parameters, opt_headers,
54 return remoting.xhr.doMethod('GET', url, onDone, opt_parameters,
59 * Execute an XHR POST asynchronously.
70 * XHR.
73 remoting.xhr.post = function(url, onDone, opt_parameters, opt_headers,
75 return remoting.xhr.doMethod('POST', url, onDone, opt_parameters,
80 * Execute an XHR DELETE asynchronously.
91 * XHR.
94 remoting.xhr.remove = function(url, onDone, opt_parameters, opt_headers,
96 return remoting.xhr.doMethod('DELETE', url, onDone, opt_parameters,
101 * Execute an XHR PUT asynchronously.
112 * XHR.
115 remoting.xhr.put = function(url, onDone, opt_parameters, opt_headers,
117 return remoting.xhr.doMethod('PUT', url, onDone, opt_parameters,
134 * XHR.
137 remoting.xhr.doMethod = function(methodName, url, onDone,
141 var xhr = new XMLHttpRequest();
142 xhr.onreadystatechange = function() {
143 if (xhr.readyState != 4) {
146 onDone(xhr);
153 parameterString = remoting.xhr.urlencodeParamHash(opt_parameters);
166 xhr.open(methodName, url, true);
170 xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
175 xhr.setRequestHeader(key, opt_headers[key]);
184 xhr.withCredentials = true;
187 xhr.send(useBody ? parameterString : null);
188 return xhr;