Unable to get JSON response while using POST/PUT call
end point -> http://magentohost/rest/default/V1/categories/4/products
Whilein JSON format with POST/PUT requests for adding/updating a Product to the category using API /V1/categories/{categoryId}/products under catalogCategoryLinkRepositoryV1
from the
Reference link: http://devdocs.magento.com/swagger/index.html#/
The request which I am sending has a header withAPI: catalogCategoryLinkRepositoryV1 -> /V1/categories/{categoryId}/products
End point URL -> http:///rest/default/V1/categories/4/products
Header:
Content-Type and Authorization and: application/json Authorization:
Request body as below in JSON format,:
{
"productLink": {
"sku": "Happiest_Minds_Bag",
"position": 0,
"categoryId": "4",
"extensionAttributes": {}
}
}
Response: "true"
The response which I get is a plain string "true" when thewith status code is "200 OK". But for any other error status code wefor this request I get a proper JSON response.
Why am I not getting response in JSON format for status code "200 OK"?