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

HappyCoder picture HappyCoder · Jan 16, 2015 · Viewed 11k times · Source

I am using ApiGility to update a shopping basket products and quantities and am testing with Chromes Postman.

I am using the PUT method to send my form data to the api and keep getting the following error:

JSON decoding error: Syntax error, malformed JSON

This is a screenshot of my PostMan setup:

enter image description here

I have tried setting Content-Type as Text however I then get a "INvalid content-type specified" error.

Is there a way to set PostMan to send Json?

Answer

Chuk Shirley picture Chuk Shirley · Feb 2, 2015

The problem is that you're trying to send parameters as form data. Instead you'll want to send it as "raw." Click on the "raw" tab in the Headers section. Then enter your data as a JSON string.

{"quantity_accumulation": "1"}

enter image description here