I need to create (with XWiki API REST) a BlogPost. But I don't know to use REST... With this command :
$ curl -u Admin:admin -X PUT --data-binary "@newpage.xml" -H "Content-Type: application/xml" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/NewPage
and with this XML file :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<page xmlns="http://www.xwiki.org">
<title>Hello world</title>
<syntax>xwiki/2.0</syntax>
<content>This is a new page</content>
</page>
I create a Page in the space Main
. But I want a BlogPost in the space Blog
. What's the markup that I must use? (I have found this command here)
The right command to use is:
The XML file should look like:
A few things to note:
PUT
a title and parent into a new document, then you can add objects to it.POST
, and the URL is obtained by appending/objects
to the document's REST URL.&#39;
), while sent resources should have entities encoded only once ('
).