hortonworks data platform - Ambari api POST complaining CSRF protection -
i trying set hbase property through ambari api using following command
curl -u "admin:admin" -i -x post -d '{"type": "hbase-site", "tag": "version3", "properties" : {"hbase.regionserver.global.memstore.size" : "0.6"}}' https://abct.net/api/v1/clusters/xyz/configurations
but keep getting following error
http/1.1 400 bad request content-length: 107 content-type: text/plain expires: thu, 01 jan 1970 00:00:00 gmt server: microsoft-iis/8.5 x-ms-hdi-active: 10.8.18.29 x-frame-options: deny x-xss-protection: 1; mode=block user: admin x-powered-by: arr/3.0 set-cookie: ambarisessionid=2e8ortl32j1p7zdjatigdgvg;path=/;httponly; path=/; secure x-powered-by: asp.net date: mon, 12 sep 2016 18:19:38 gmt { "status" : 400, "message" : "csrf protection turned on. x-requested-by http header required." }
what missing here ?
turns out have add request header request other request.
you can add header with
curl --header "x-requested-by: my_computer_name"
or
you can disable feature.
Comments
Post a Comment