diff --git a/src/app/services/api.service.ts b/src/app/services/api.service.ts index c16d1e8..61e2917 100644 --- a/src/app/services/api.service.ts +++ b/src/app/services/api.service.ts @@ -22,14 +22,21 @@ export class ApiService { this.node.setLoading(); } } - let header; + let options: any = { + responseType: 'json', + }; if (this.appSettings.settings.serverAuth != null && this.appSettings.settings.serverAuth !== '') { - header = { - headers: new HttpHeaders() - .set('Authorization', this.appSettings.settings.serverAuth) - }; + options = + Object.assign( + {}, + options, + { + headers: new HttpHeaders() + .set('Authorization', this.appSettings.settings.serverAuth) + } + ); } - return await this.http.post(apiUrl, data, header).toPromise() + return await this.http.post(apiUrl, data, options).toPromise() .then(res => { this.node.setOnline(); return res;