angular.js - angular4 发出post请求 服务端显示OPTIONS
ringa_lee
ringa_lee 2017-05-16 13:18:24
0
1
1308

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);
}

用postman请求正常显示post请求

ringa_lee
ringa_lee

ringa_lee

人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!