无效的属性标识符字符:\\.路径“,”第1行, Postman 中得位置1

p8ekf7hl  于 2022-11-07  发布在  Postman
关注(0)|答案(1)|浏览(170)

我在服务头中传递了一个类似这样的字符串。

FormData = "{\"LeaveEntryCode\":0,\"RequestId\":0,\"EmployeeCode\":17227,\"LeaveYear\":2016,\"LeaveTypeCode\":1,\"BaseType\":\"ess\",\"StartDate\":\"2016-08-2T00:00:00\",\"EndDate\":\"2016-08-2T00:00:00\",\"NoOfDays\":1.0,\"StartDateSession\":\"full\",\"EndDateSession\":\"half\",\"PreApproved\":false,\"ForDate\":\"1901-01-01T00:00:00\",\"Remarks\":\"Test\",\"RequestStatus\":\"P\",\"Deleted\":false,\"Status\":false,\"CreatedBy\":0,\"CreatedDate\":\"0001-01-01T00:00:00\",\"UpdatedBy\":0,\"UpdatedDate\":\"0001-01-01T00:00:00\",\"DeletedBy\":0,\"DeletedDate\":\"0001-01-01T00:00:00\",\"ModuleId\":2,\"ObjectId\":20,\"StartDateString\":\"08/2/2016\",\"EndDateString\":\"08/2/2016\",\"LeaveDayList\":[\"08/02/2016-FH,08/02/2016-SH\"],\"SystemLeaveTypeCode\":\"ANN\",\"LeaveTypeName\":\"ANNUAL\",\"Employee\":\"\",\"LieuDayList\":null,\"LeaveReasonCode\":0,\"CoveringPersonCode\":0,\"AttachedDocument\":null,\"BaseLeaveType\":\"ANN\",\"CoveringPersonName\":null,\"LeaveReasonName\":null,\"DocumentSource\":\"LEAVE\"}";

这个FormData是头文件名。但是我在postman中得到这个错误

"Message": "An error has occurred.",
  "ExceptionMessage": "Invalid property identifier character: \\. Path '', line 1, position 1.",
  "ExceptionType": "Newtonsoft.Json.JsonReaderException",
  "StackTrace": "   at Newtonsoft.Json.JsonTextReader.Pars

这是什么原因?请帮帮我。谢谢

g2ieeal7

g2ieeal71#

选择type as raw和content as Json,并将其复制到正文中的json下方。

{
"LeaveEntryCode": 0,
"RequestId": 0,
"EmployeeCode": 17227,
"LeaveYear": 2016,
"LeaveTypeCode": 1,
"BaseType": "ess",
"StartDate": "2016-08-2T00:00:00",
"EndDate": "2016-08-2T00:00:00",
"NoOfDays": 1.0,
"StartDateSession": "full",
"EndDateSession": "half",
"PreApproved": false,
"ForDate": "1901-01-01T00:00:00",
"Remarks": "Test",
"RequestStatus": "P",
"Deleted": false,
"Status": false,
"CreatedBy": 0,
"CreatedDate": "0001-01-01T00:00:00",
"UpdatedBy": 0,
"UpdatedDate": "0001-01-01T00:00:00",
"DeletedBy": 0,
"DeletedDate": "0001-01-01T00:00:00",
"ModuleId": 2,
"ObjectId": 20,
"StartDateString": "08/2/2016",
"EndDateString": "08/2/2016",
"LeaveDayList": ["08/02/2016-FH,08/02/2016-SH"],
"SystemLeaveTypeCode": "ANN",
"LeaveTypeName": "ANNUAL",
"Employee": "",
"LieuDayList": null,
"LeaveReasonCode": 0,
"CoveringPersonCode": 0,
"AttachedDocument": null,
"BaseLeaveType": "ANN",
"CoveringPersonName": null,
"LeaveReasonName": null,
"DocumentSource": "LEAVE"
}

相关问题