我是角度的新手,试图为我的对象模型制作参数,每当我对我的对象进行字符串化时,它都会生成一个 API 不接受的大字符串。我该怎么办..?
这是我要转换为参数的对象。
{
"qaevaluationid": 1,
"agentid": 1,
"callerid": "1234",
"calledon": "02/13/2020 10:38:14 AM",
"duration": "304",
"overallfeedback": "adasdasd",
"isfatal": false,
"fatalcallreasonid": "3",
"evaluationtypeid": "1",
"callratings": [{
"callratingid": 1,
"createdby": 1,
"createdbyname": "john",
"createdon": null,
"evaluationfactorid": 8,
"is_deleted": "F",
"modifiedby": -1,
"modifiedbyname": "",
"modifiedon": null,
"qaevaluationid": 1,
"rating": "7"
}, {
"callratingid": 2,
"createdby": 1,
"createdbyname": "john",
"createdon": null,
"evaluationfactorid": 9,
"is_deleted": "F",
"modifiedby": -1,
"modifiedbyname": "",
"modifiedon": null,
"qaevaluationid": 1,
"rating": "6"
}, {
"callratingid": 3,
"createdby": 1,
"createdbyname": "john",
"createdon": null,
"evaluationfactorid": 10,
"is_deleted": "F",
"modifiedby": -1,
"modifiedbyname": "",
"modifiedon": null,
"qaevaluationid": 1,
"rating": "8"
}],
"createdby": 1,
"createdbyname": "John",
"createdon": null,
"modifiedby": -1,
"modifiedbyname": null,
"modifiedon": null,
"is_deleted": "F"
}
在 TypeScript 中我正在这样做
this.httpOptions.params = new HttpParams();
this.httpOptions.params = this.httpOptions.params.set('qaEval', JSON.stringify(qaevaluation));
return this._httpClient.post<APIResponse<QAEvaluation>>(this.myAppUrl + 'QAEvaluation/insert', { qaEval: qaevaluation }, this.httpOptions)
.pipe(retry(1), catchError(this.errorHandler));
收到此错误