import { Frame, Http, Observable } from '@nativescript/core'; export class LoginModel extends Observable { public server: string = 'http://192.168.178.59:8080'; public username: string; public password: string; constructor() { super(); } async onLogin() { const content = new FormData(); content.append('username', this.username); content.append('password', this.password); const response = await Http.request({ url: this.server, method: 'POST', content: content, }); console.log(response.content?.toString()); } goToGalleries() { const frame = Frame.topmost(); frame.navigate('gallery-page'); } }