Created 09-03-2016 06:08 AM
POST : http://192.168.1.56:21000/api/atlas/types
Body : { "enumTypes": [], "structTypes": [], "traitTypes": [ { "superTypes": [], "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.TraitType", "typeName": "TagColumn_56_Api", "attributeDefinitions": [ { "testAttrKey": "TestAttrValue" } ] } ], "classTypes": [] }
Response: { "msgDesc": "Missing Required Header for CSRF Vulnerability Protection" } I am passing the credential from Authorization tab. what should I pass in the header? Please suggest the solution. Thanks in Advance.
Created 09-07-2016 04:10 AM
When using postman you may have to add the below header for POST requests. GET requests work without this header.
X-XSRF-HEADER:valid
Created 09-06-2016 08:23 PM
This like some sort of issue with the REST client. Try the same thing using CURL as the rest client.
Copy and past: { "enumTypes": [], "structTypes": [], "traitTypes": [ { "superTypes": [], "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.TraitType", "typeName": "TagColumn_56_Api", "attributeDefinitions": [ { "testAttrKey": "TestAttrValue" } ] } ], "classTypes": [] }
into a file called payload.json.
curl -u admin:admin -d @payload.json -H "Content-Type: application/json" -X POST http://192.168.1.56:21000/api/atlas/types
Let me know if that works.
Created 09-07-2016 06:54 AM
@Vadim Vaks Thanks for the reply. I added the "X-XSRF-HEADER:valid" header and it worked in postman. 🙂 But from other Rest Client say "Advanced Rest Client", it worked without this header. And with the CURL its working fine as you said.
Created 09-07-2016 04:10 AM
When using postman you may have to add the below header for POST requests. GET requests work without this header.
X-XSRF-HEADER:valid
Created 09-07-2016 06:52 AM
Thanks for the answer. I added the said header and it worked in postman. :) But from other Rest Client say "Advanced Rest Client", it worked without this header.