REST API: Create Wiki Pages
Added by Martin Jung over 11 years ago
Hello all,
I am trying to use the REST API to create wiki pages.
While retrieving and deleting works, the PUT requests for creating fail with
422 "Text field can't be blank"
The PUT request I am sending is exactly as described in Rest_WikiPages (Only addition is the parent page)
< ?xml version="1.0"? > <!--Blanks are inentional to be rendered correctly in the forum -->
<wiki_page>
<title>TestPage</title>
<parent title="Helloworld"/>
<text>h1. TestPage\n\nSome Example Text</text>
<comments>Generated Page, do not edit!</comments>
</wiki_page>
I am using javas jersey library to access the REST API like this.
WebResource createResource = client.resource(uri);
ClientResponse createResponse = createResource.accept(MediaType.TEXT_XML).put(ClientResponse.class,
"< ?xml version=\"1.0\"? >"+
"<wiki_page>"+
"<title>TestPage</title>"+
"<parent title=\"Helloworld\"/>"+
"<text>h1. TestPage\n\nSome Example Text</text>"+
"<comments>Generated Page, do not edit!</comments>"+
"</wiki_page>");
I am running a virtual machine (the turnkey appliance) as the redmine server:
Redmine version 2.2.3.stable Ruby version 1.8.7 (x86_64-linux) Rails version 3.2.12 Environment production Database adapter MySQL
Any help is greatly apprecieated.
Best regards,
Martin