Version 12 API POST issue (no longer accepts JSON object in the body)

Hello,

There seems to be a change in how we should post JSON data into the POST API.
If for example I’m trying to add some item via the REST API:
/api/resource/item

In version 11 (previously master) a request body like this works

{
“item_code”: “888”,
“item_name”: “Test Item”,
“item_group”: “Master item”,
“is_stock_item”: 1,
“is_purchase_item”: 1
}

However as soon as I updated to version 12, I needed to use:
application/x-www-form-urlencoded
and the request as form parameters:

data={
“item_code”: “112971”,
“item_name”: “CHP-7310R”,
“item_group”: “Water Purifier”,
“is_stock_item”: 1,
“is_purchase_item”: 1
}

Is this intended or is this a bug? Thanks all.

2 Likes