Updated Branches: refs/heads/master f306e3c93 -> 5dd178714
Document some other basic property access patterns. Project: http://git-wip-us.apache.org/repos/asf/labs-oak/repo Commit: http://git-wip-us.apache.org/repos/asf/labs-oak/commit/5dd17871 Tree: http://git-wip-us.apache.org/repos/asf/labs-oak/tree/5dd17871 Diff: http://git-wip-us.apache.org/repos/asf/labs-oak/diff/5dd17871 Branch: refs/heads/master Commit: 5dd178714e9aedb43224f28fb404c6838e2b05c6 Parents: 3dedecb Author: Jukka Zitting <[email protected]> Authored: Wed Feb 1 00:49:59 2012 +0100 Committer: Jukka Zitting <[email protected]> Committed: Wed Feb 1 00:49:59 2012 +0100 ---------------------------------------------------------------------- oak.xml | 30 ++++++++++++++++++++++++++++-- 1 files changed, 28 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/labs-oak/blob/5dd17871/oak.xml ---------------------------------------------------------------------- diff --git a/oak.xml b/oak.xml index 2e9ec03..d107b0d 100644 --- a/oak.xml +++ b/oak.xml @@ -65,11 +65,37 @@ resource:</para> <informalexample> - <screen>$ culr -d foo=xyz -d bar=123 http://localhost:8080/ + <screen>$ curl -d foo=xyz -d bar=123 http://localhost:8080/ {"foo":"xyz","bar":123}</screen> </informalexample> - <para> </para> + <para>Updating an already existing property is just as easy.</para> + + <para><informalexample> + <screen>$ curl -d foo=abc http://localhost:8080/ +{"foo":"abc","bar":123}</screen> + </informalexample>Note how only the POSTed property gets modified; any + other properties of the addressed resource remain unaffected.</para> + + <para>In addition to scalar values like strings and numbers, a property + can also contain an array of multiple values. For example, let's try + adding three different values to the same property.</para> + + <para><informalexample> + <screen>$ curl -d foo=abc -d foo=def -d foo=ghi http://localhost:8080/ +{"foo":["abc","def","ghi"],"bar":123}</screen> + </informalexample>In addition to presenting a resource as a JSON + object, Oak allows you to address individual properties directly.</para> + + <para><informalexample> + <screen>$ curl http://localhost:8080/foo +abc +def +ghi +$ curl http://localhost:8080/bar +123</screen> + </informalexample>By default Oak returns the contents of individual + properties as plain text, one value per line. </para> </section> </chapter> </book> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
