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
難道我的回答可以幫助您?一些反饋會很好 – Dinistro
嘿Dinistro,你的答案確實有很大的意義。感謝您的幫助=) –