* Compute the URL to use to make a request. * @private * @param {string} path - either a URL relative to the API base or an absolute URL * @return {string} - the URL to use
(path)
| 71 | * @return {string} - the URL to use |
| 72 | */ |
| 73 | __getURL(path) { |
| 74 | let url = path; |
| 75 | |
| 76 | if (path.indexOf('//') === -1) { |
| 77 | url = this.__apiBase + path; |
| 78 | } |
| 79 | |
| 80 | let newCacheBuster = 'timestamp=' + new Date().getTime(); |
| 81 | return url.replace(/(timestamp=\d+)/, newCacheBuster); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Compute the headers required for an API request. |