无效的属性标识符字符:\\。路径'',第1行,邮递员中的第1位

时间:2016-08-01 14:47:57

标签: json postman

我在服务标题中传递了这样的字符串。

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

这有什么共鸣? 请帮我。 感谢

1 个答案:

答案 0 :(得分:0)

选择类型为raw,内容为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"
}