Here's my command:
curl -u fvila:"password" -X POST -H "Content-Type: application/json" --data "@data1.json" --url http://localhost:8090/confluence/rest/api/content/
I'm was getting this response from the api:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 34604 0 34604 0 0 389k 0 --:--:-- --:--:-- --:--:-- 392k
Expecting value: line 3 column 1 (char 6)
Now using the Confluence password, instead of a generated token, it's as follows:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 827 100 697 100 130 18473 3445 --:--:-- --:--:-- --:--:-- 22351
Expecting value: line 1 column 1 (char 0)
(100% received and 100% Xferd, but error on line 1 column 1 instead of line 3 column 1 )
here's the content of data1.json:
{
"type":"page",
"title":"new page",
"space":{"key":"TC"},
"ancestors": [ {"id": "360452" }],
"body":"<p>This is <br/> a new page</p>"
}When I remove the `| python -mjson.tool`, I get a full http page response, including:
<div id="footer" role="contentinfo">
<section class="footer-body">
<p class="license license-eval">
<strong>EVALUATION LICENSE</strong>
Are you enjoying Confluence? Please consider <a href="https://www.atlassian.com/purchase/product/confluence-data-center">purchasing it</a> today.
</p>
<ul id="poweredby">
<li class="noprint">Powered by <a href="http://www.atlassian.com/software/confluence" class="hover-footer-link" rel="nofollow">Atlassian Confluence</a> <span id='footer-build-information'>7.13.8</span></li>
<li class="print-only">Printed by Atlassian Confluence 7.13.8</li>
<li class="noprint"><a href="https://support.atlassian.com/help/confluence" class="hover-footer-link" rel="nofollow">Report a bug</a></li>
<li class="noprint"><a href="https://www.atlassian.com/company" class="hover-footer-link" rel="nofollow">Atlassian News</a></li>
</ul>
<div id="footer-logo"><a href="http://www.atlassian.com/" rel="nofollow">Atlassian</a></div>
</section>
</div>