Hi Vinu, You should switch to Httplient instead of using http. Aside from that, this is straight from the docs <https://angular.io/api/http/Http#post>:
post(url: string, body: any, options?: RequestOptionsArgs > <https://angular.io/api/http/RequestOptionsArgs>): Observable<Response > <https://angular.io/api/http/Response>> > So the complete payload you want to post is in the second parameter, and the thirth parameter is the options of the post . Also, it cleary states that it returns an observabe. As that is an object, your alert is right with [Object Object], as that is what it is. Do read something about how to deal with asynchrone requests. for now try something llike this: this._http.post("http://192.168.0.102:8000/user.lua",{uname,pass}) .map(result => result.json()) .catch(error => {console.error(error); return Observable.empty()} .subscribe(data => console.log('result',data) As a rule of thumb, you should have a maxium of 1 subscribe calls in your component, but that's for later on. Hope this helps you a bit, Regards Sander -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
