Ich versuche, ein Objekt in json Server zu posten, aber ich habe den 500 internen Server Fehler. Unten sind meine Codes.POST http: // localhost: 3000/claimdetails 500 (Interner Serverfehler)
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);}
Komponente:
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
Habe meine Antwort geholfen? Einige Rückmeldungen wären toll – Dinistro
Hey Dinistro, deine Antwort hat viel Sinn ergeben. Danke für deine Hilfe =) –