I am working on Angular 8
I am trying to send data to server as HttpParams but getting 502 error
HttpErrorResponse {headers: HttpHeaders, status: 502, statusText: "Bad Gateway"
In browser's Network's Header i can see that data is going as formData
I am sharing my code
service file
userlogin(userid, smpassword) {
const params = new HttpParams()
.set('user_id', userid)
.set('sm_password', smpassword);
console.log(params);
return this.http.post(this.baseUrl + 'user/login', params);
}
component
login() {
const email = this.Userlogin.get('email').value;
const password = this.Userlogin.get('password').value;
this.rest.userlogin(email, password).subscribe(
result => {
console.log(result);
}
);
// this.route.navigateByUrl('/pendingapproval');
}