2015-01-16 48 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