* Create a http request to the public API * @param {string} url - The http endpoint * @param {object} data - The data to send * @param {function} callback - The callback method to call * @param {string} method - the http method * @return {undefined}
(url: string, data: Dict = {}, method: HttpMethod = 'GET')
| 667 | * @return {undefined} |
| 668 | */ |
| 669 | async apiRequest(url: string, data: Dict = {}, method: HttpMethod = 'GET') { |
| 670 | this.requireApiKey('apiRequest'); |
| 671 | const opt = this.reqObj( |
| 672 | url, |
| 673 | data, |
| 674 | method, |
| 675 | this.APIKEY |
| 676 | ); |
| 677 | const res = await this.proxyRequest(opt); |
| 678 | return res; |
| 679 | } |
| 680 | |
| 681 | requireApiKey(source = 'requireApiKey', fatalError = true) { |
| 682 | if (!this.APIKEY) { |
no test coverage detected