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,你的答案确实有很大的意义。感谢您的帮助=) –