Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
Description
Some people prefer to use POST method instead of MKCOL when creating a node.
Using MKCOL by default
$ curl --request MKCOL --data @- --user admin:admin \ > http://localhost:8080/cms/server/default/jcr:root/hello/ <<END > <sv:node sv:name="hello" xmlns:sv="http://www.jcp.org/jcr/sv/1.0"> > <sv:property sv:name="message" sv:type="String"> > <sv:value>Hello, World!</sv:value> > </sv:property> > <sv:property sv:name="date" sv:type="Date"> > <sv:value>2012-12-31T12:00:00.000Z</sv:value> > </sv:property> > </sv:node> > END
It might be useful if POST is accepted as MKCOL optionally:
Using POST method for MKCOL internally
$ curl --request POST --header "Content-Type: applicaiton/xml" --data @- --user admin:admin \ > http://localhost:8080/cms/server/default/jcr:root/hello/ <<END > <sv:node sv:name="hello" xmlns:sv="http://www.jcp.org/jcr/sv/1.0"> > <sv:property sv:name="message" sv:type="String"> > <sv:value>Hello, World!</sv:value> > </sv:property> > <sv:property sv:name="date" sv:type="Date"> > <sv:value>2012-12-31T12:00:00.000Z</sv:value> > </sv:property> > </sv:node> > END