2015-01-16 35 views
1

我正在使用ApiGility更新購物籃產品和數量,並正在使用Chromes郵差測試。ApiGility - JSON解碼錯誤:語法錯誤,PostMan中格式不正確的JSON

我使用PUT方法來我的表單數據發送到API,並不斷收到以下錯誤:

JSON decoding error: Syntax error, malformed JSON 

這是我的郵差設置的截圖:

enter image description here

我曾嘗試將Content-Type設置爲文本,但是然後出現「無效的內容類型指定」錯誤。

有沒有辦法讓PostMan發送Json?

回答

7

的問題是,你想發送參數表格數據。相反,您需要將其發送爲「原始」。點擊標題部分的「原始」選項卡。然後輸入您的數據作爲JSON字符串。

{"quantity_accumulation": "1"} 

enter image description here

0

試圖通過你的參數x-www-form-urlencoded而不是form-data並設置內容類型:

Content-Type: application/x-www-form-urlencoded