0
オブジェクトをjsonサーバーにポストしようとしていますが、500の内部サーバーエラーが発生しました。以下は私のコードです。POST http:// localhost:3000/claimdetails 500(内部サーバーエラー)
app.service:
createService(url: string, param: any): Promise<any> {
let body = JSON.stringify(param);
return this.http
.post(url, body, this.options)
.toPromise()
.then(this.extractData)
.catch(this.handleError);}
コンポーネント:
save() {
var json = JSON.stringify({
purpose: this.purpose
});
this.appService
.createService('http://localhost:3000/claimdetails', json)
.then(result => console.log("5. createService: " + result))
.catch(error => console.log(error));}
ERROR: error
がなかった私の答えを助けます:あなたは、
observables
でpromises
のための必要性を全く同じことを行うことはできませんか?いくつかのフィードバックは素晴らしいだろう – DinistroちょっとDinistro、あなたの答えは多くの意味を作った。あなたの助けをありがとう=) –