I have been following REST API documentation for Confluence, trying to create a new page, but still I have no new page in confluence and json decoder seems to be not working.
This is the command that I am using:
curl -u recovery_admin:qwerty -X POST -H 'Content-Type: application/json' -d '{"type":"page","title":"new page",
"space":{"key":"CM"},"body":{"storage":{"value":"<p>This is <br/> a new page</p>","representation":
"storage"}}}' http://localhost:8090/confluence/rest/api/content/ | python -mjson.toolThis is a confluence version that I use only for test purposes, and I am running curl from the same machine where confluence is hosted in port 8090. The space tag is CM.
With python (who uses python 2) or even python3 (who uses python 3), I am unable to encode curl outputs.
With python 2:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 35507 0 35507 0 0 236k 0 --:--:-- --:--:-- --:--:-- 237k
No JSON object could be decoded
With python 3
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 35507 0 35507 0 0 225k 0 --:--:-- --:--:-- --:--:-- 225k
Expecting value: line 2 column 1 (char 5)
Without using python -json.tool I can see that I can get curl output data, but its hard do understand what may have occur. =/
Anyone knows what I am doing wrong to be unable to create the page in that space and why I am unable to decode in JSON?