* @param {string} method * @param {string} url * @return {!XMLHttpRequest} * @private
(method, url)
| 13561 | * @private |
| 13562 | */ |
| 13563 | function createXhrRequest(method, url) { |
| 13564 | const xhr = new XMLHttpRequest(); |
| 13565 | if ('withCredentials' in xhr) { |
| 13566 | xhr.open(method, url, true); |
| 13567 | } else { |
| 13568 | throw new Error('CORS is not supported'); |
| 13569 | } |
| 13570 | return xhr; |
| 13571 | } |
| 13572 | |
| 13573 | /** |
| 13574 | * If 415 or in the 5xx range. |