cancel
Showing results for 
Search instead for 
Did you mean: 

Xml Content Type issue with rest API

Xml Content Type issue with rest API

i am try to use magento rest API , using JSON it's working fine but when try to require the data in xml format by sending content type as application/xml then also it's return in JSON , am i missing any setting ?

 

Thanks

Sam

1 REPLY 1

Re: Xml Content Type issue with rest API

HI,

 

have you tried adding any category using POST method? I am facing issue in that. I am trying with rest api, but its not working. Can you help me in that if you are done with this. 

 

 

I am playing with magento 2 Rest API to add category in magento admin. I am writing below code, but showing "401 Unauthorized" and showing message Consumer is not authorized to access %resources Magento_Catalog::categories

 

I am using below code to add category in magento console, can anyone help me on this? Thanks in advance.

POST Method: [MAGENTO URL]/index.php/rest/V1/categories/

 

Request Body: { "id": 0, "parentId": 0, "name": "test category", "isActive": true, "position": 0, "level": 0, "includeInMenu": true, "extensionAttributes": {}, }

 

but not working. any solution?

 

Thanks

 

Rahul Anand