From ashtarcommunications@gmail.com Sat Nov 5 08:46:13 2011 From: Ashtar Communications To: xwiki-users@xwiki.org Subject: [xwiki-users] RESTful API to create a new object of custom class? Date: Sat, 05 Nov 2011 01:46:10 -0700 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4116369438712301459==" --===============4116369438712301459== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, Is it possible to create a new object of a custom class using the RESTful API? The documentation page only lists the following POST method, which doesn't accept a class name: /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects[?start=3Doffset= &number=3Dn] I have tried things like the following: curl -u Admin:admin -X POST -H "Content-type: text/plain" -H "Accept: application/xml" -d "@test.xml" http://localhost/xwiki/rest/wikis/xwiki/spaces/Test/pages/Test/objects/XWiki.= TestClass Where test.xml contains some variation on: This is some text. Curl returns this: Status page

The method specified in the request is not allowed for the resource ident= ifi ed by the request URI

You can get technical details here.
Please continue your visit at our home page.

Simpler syntax without the XML file still fails for me. In fact, I can't seem to even get the basic "create object" method to work, even without the class. For example: curl -u Admin:admin -X POST http://localhost/xwiki/rest/wikis/xwiki/spaces/Test/pages/Test/objects Just comes back with a "malformed syntax" error. Is there an example anywhere of how to do this? Thank you, Aaron --===============4116369438712301459==--