WebApp Angular for connect to tryton server


(Vincenzo Ferraro) #1

Hello everyone,
I’m making a web app in Angular 6 to connect to the Tryton server.
I can not find a correct syntax for the post call.
In ajax the post call works, in Angular I can not …

The syntax I use in Angular is as follows:

let url = 'http://localhost:8001/<dbname>/
let data = JSON.stringify ({'method': 'common.db.login', 'id': 1, 'params': [<username>, {'password': <password>}]});
let httpOptions = { 
     headers: new HttpHeaders ({'Content-Type': 'application/json', 'Data-Type': 'json'})
};

this.http.post (url, data, httpOptions) 
.subscribe(         
     response => {
              console.log("POST Request is successful ", response);
     },
     error => {
              console.log("Error", error);
     }
); 

I receive “error 500”.

Has anyone connected to the tryton server with Angular?


(Sergio Morillo) #2

Nantic guys have a lot of experience in it. They have a package angular2-tryton based on first openlabs implementation.