首页 > 解决方案 > 邮递员:从邮递员 POST 请求中接收语法错误

问题描述

{
    "order": {
        "operationTimes": {
            "start": "",
            "end": ""
        },
        "forCustomer": "87778",
        "type": "8787",
        "stand": "",
        "plannedStartAt": "",
        "begin": {
            "number": "9445",
            "destination": "8787",
            "suffix": "",
            "originDate": "21\/02\/2021",
            "isNew": true,
            "origin": "989898",
            "existingId": "",
            "company": "98998"
        },
        "private": false,
        "loc": "",
        "types": "test",
        "date": "21\/02\/2021",
        "transactionType": "",
        "testSupplier": "88881d335b647351068b0000",
        "cust": "343434"
    },
    "forNew": false
}

但是,当我在 Postman 中将其作为原始内容发布时,我收到以下语法错误:

Failed to parse data (org.json.JSONException: Expected a ',' or '}' at 650 [character 45 line 26]

这指向这testSupplier条线,但我看不到我在这里遗漏了什么。我不想}在此时关闭对象,因为我有更多属性是order对象的一部分。我已经有一个,. 显然,这个错误阻止了全文发布,因此我收到了 400 响应。

任何帮助将不胜感激。

在此处输入图像描述

更新:

当我通过 Charles 代理检查呼叫时,这是实际发布在正文中的内容:

{
    "fuelOrder": {
        "operationTimes": {
            "onBlocksAtScheduled": "",
            "offBlocksAtScheduled": ""
        },
        "forCustomer": "3255",
        "fuelType": "23523",
        "stand": "",
        "plannedStartAt": "",
        "outbound": {
            "number": "9445",
            "destination": "235235",
            "suffix": "",
            "originDate": "21\/02\/2021",
            "isNew": true,
            "origin": "235235",
            "existingId": "",
            "airline": "52323523"
        },
        "privateFlight": false,
        "terminal": "",
        "type": "ref",
        "date": "21\/02\/2021",
        "transactionType": "",
        "fuelSupplier": "23523"

所以它之后没有发布任何东西fuelSupplier

这就是错误在查尔斯中的显示方式

在此处输入图像描述

标签: jsonpostpostman

解决方案


推荐阅读