ApiGility - JSON decoding error: Syntax error, malformed JSON in PostMan

ApiGility - JSON decoding error: Syntax error, malformed JSON in PostMan

我正在使用 ApiGility 更新购物篮产品和数量,并正在使用 Chromes Postman 进行测试。

我正在使用 PUT 方法将我的表单数据发送到 api 并不断收到以下错误:

JSON decoding error: Syntax error, malformed JSON

这是我的 PostMan 设置的屏幕截图:

我曾尝试将 Content-Type 设置为文本,但随后出现 "INvalid content-type specified" 错误。

有没有办法设置 PostMan 发送 Json?

尝试在 x-www-form-urlencoded 中传递您的参数而不是 form-data 并将您的内容类型设置为:

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

问题是您试图将参数作为表单数据发送。相反,您需要将其发送为 "raw." 单击 Headers 部分中的 "raw" 选项卡。然后将您的数据作为 JSON 字符串输入。

{"quantity_accumulation": "1"}