(method: string, url: string, async: ?boolean)
| 431 | } |
| 432 | |
| 433 | open(method: string, url: string, async: ?boolean): void { |
| 434 | /* Other optional arguments are not supported yet */ |
| 435 | if (this.readyState !== this.UNSENT) { |
| 436 | throw new Error('Cannot open, already sending'); |
| 437 | } |
| 438 | if (async !== undefined && !async) { |
| 439 | // async is default |
| 440 | throw new Error('Synchronous http requests are not supported'); |
| 441 | } |
| 442 | if (!url) { |
| 443 | throw new Error('Cannot load an empty url'); |
| 444 | } |
| 445 | this._method = method.toUpperCase(); |
| 446 | this._url = url; |
| 447 | this._aborted = false; |
| 448 | this.setReadyState(this.OPENED); |
| 449 | } |
| 450 | |
| 451 | send(data: any): void { |
| 452 | if (this.readyState !== this.OPENED) { |
no test coverage detected