- this.axios = axios.create({
- validateStatus: (statusCode) => (Math.floor(statusCode / 100)) === 2,
- headers: {
- 'User-Agent': 'FakeClient',
- },
- });
+ this.Got = undefined;
+ this.got = this._init.bind(this);
+ }
+
+ async _init(...args) {
+ if (!this.Got) {
+ // eslint-disable-next-line
+ this.Got = await import('got');
+ this.got = this.Got.got.extend({
+ headers: {
+ 'User-Agent': 'FakeClient',
+ },
+ responseType: 'text',
+ });
+ }
+ if (args.length) {
+ return this.got(...args);
+ }