Rest Api调用中的时间戳错误

时间:2018-06-26 09:53:35

标签: json restsharp

我正在尝试使用RestSharp RestClient将Json数据发送到Rest API。不管我做什么,都会一遍又一遍地得到相同的错误。

  

“ {\”状态\“:\”错误\“,\”代码\“:400,\”消息\“:\”有效载荷无效:   无法将输入解析为有效的JSON \“,\” timestamp \“:1529940854}”

我发送的数据是:

componentWillUnmount

swagger文件显示:

pip install django-markdown-deux

醒目的示例显示:

{  
   "type":"order",
   "id":"CD-13291565",
   "timestamp":"2018-06-25T15:25:35+00",
   "grand_total":10.68,
   "subtotal":7.69,
   "discount":0,
   "shipping":2.99,
   "tax":0,
   "currency":"GBP",
   "status":"Paid",
   "is_valid":true,
   "customer":{  
      "id":"67218",
      "email":"mmouse@disney.com",
      "firstname":"Mickey",
      "lastname":"Mouse"
   },
   "lineitems":[  
      {  
         "product_id":"204368",
         "sku":"204368",
         "variant_id":null,
         "quantity":1,
         "unit_price":7.69,
         "quantity_refunded":0,
         "refunded":0,
         "subtotal":7.69,
         "tax":0,
         "total":7.69,
         "discount":0,
         "is_on_sale":false,
         "variant_options":null,
         "totals":null
      }
   ],
   "ip_address":null,
   "channel":"online",
   "store":"Acme",
   "payment_method":"0",
   "shipping_method":"Royal Mail Standard 2nd Class",
   "shipping_address":{  
      "city":"Orlando",
      "state":"Florida",
      "postcode":"32830",
      "country_code":"US"
   },
   "billing_address":{  
      "city":"Orlando",
      "state":"Florida",
      "postcode":"32830",
      "country_code":"US"
   },
   "coupon_code":null
}

我尝试了许多不同的日期格式,但总是得到相同的结果:

"timestamp": {
  "type": "string",
  "description": "Date and time the order was placed on the site or in store. Following ISO 8601 dateTime format with timezone offset _YYYY-MM-DDThh:mm:ss+Z_.",
  "format": "date-time"
},

一些都给出了相同的结果。

当我通过Json验证器运行Json时,它就会通过。

我缺少明显的东西吗?

0 个答案:

没有答案