[Webkit-unassigned] [Bug 169970] JavaScript is not correctly connecting to rest api in iOS 10.3 beta
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Mar 24 15:49:18 PDT 2017
https://bugs.webkit.org/show_bug.cgi?id=169970
--- Comment #11 from paladox <thomasmulhall410 at yahoo.com> ---
It looks like polygerrit uses https://github.com/github/fetch/
Example code
fetchJSON: function(url, opt_errFn, opt_cancelCondition, opt_params,
opt_opts) {
opt_opts = opt_opts || {};
var fetchOptions = {
credentials: 'same-origin',
headers: opt_opts.headers,
};
var urlWithParams = this._urlWithParams(url, opt_params);
return fetch(urlWithParams, fetchOptions).then(function(response) {
if (opt_cancelCondition && opt_cancelCondition()) {
response.body.cancel();
return;
}
if (!response.ok) {
if (opt_errFn) {
opt_errFn.call(null, response);
return;
}
this.fire('server-error', {response: response});
return;
}
return this.getResponseObject(response);
}.bind(this)).catch(function(err) {
if (opt_errFn) {
opt_errFn.call(null, null, err);
} else {
this.fire('network-error', {error: err});
throw err;
}
throw err;
}.bind(this));
},
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170324/aca39207/attachment.html>
More information about the webkit-unassigned
mailing list