angular.js - angular4 makes a post request and the server displays OPTIONS
ringa_lee
ringa_lee 2017-05-16 13:18:24
0
1
1307

private headers = new Headers({'Content-Type': 'application/json'});

private url = 'localhost:3000/users/register'; 
constructor(private http: Http) { }

registerEmail(link:string , email: string , password: string): Promise<any> 
{
return this.http
  .post(this.url, JSON.stringify({email: email , password: password}), {headers: this.headers})
  .toPromise()
  .then(res => res.json().data)
  .catch(this.handleError);
}

Use postman to request to display the post request normally

ringa_lee
ringa_lee

ringa_lee

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!