Small Cleaning and autorun bug fix
This commit is contained in:
@@ -8,18 +8,18 @@ import { HttpErrorResponse } from '@angular/common/http';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NetworkRequestsService {
|
||||
constructor(private readonly _httpClient: HTTP, public toastController: ToastController) { }
|
||||
constructor(private readonly httpClient: HTTP, public toastController: ToastController) { }
|
||||
|
||||
public sendCommand(command: string, address: string, port: number, connectionProtocol?: string,) {
|
||||
const request: NetRequest = {
|
||||
command: command,
|
||||
}
|
||||
command,
|
||||
};
|
||||
|
||||
this._httpClient.setDataSerializer('json');
|
||||
this._httpClient.setServerTrustMode('nocheck');
|
||||
this.httpClient.setDataSerializer('json');
|
||||
this.httpClient.setServerTrustMode('nocheck');
|
||||
|
||||
this._httpClient.post(encodeURI(`${connectionProtocol ?? 'http'}://${address + ":" + port}/commandbridge`), request, {
|
||||
ContentType: 'text/html;'
|
||||
this.httpClient.post(encodeURI(`${connectionProtocol ?? 'http'}://${address + ':' + port}/commandbridge`), request, {
|
||||
contentType: 'text/html;'
|
||||
}).catch(response => {
|
||||
this.showErrorMessage(response);
|
||||
});
|
||||
@@ -34,4 +34,4 @@ export class NetworkRequestsService {
|
||||
});
|
||||
toast.present();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user