I'm having fun with RESTXQ, this is an easy and efficient way to create REST interfaces once you learn how.
Two questions:
1. How do I return a forest of elements? Multi-part MIME types? If so, how do I specify that? What do I need to add to this particular declaration?
(:~
Look up all entries in the Abbott-Smith lexicon that contain an English word in the gloss.
:)
declare
%rest:path("/api/abbott-smith/gloss/{$g}")
%rest:GET
%output:method('xml')
function as:gloss($g)
{
$as:abbott-smith/*:entry[.//*:gloss[contains-token(lower-case(.), lower-case($g))] ]
};
2. Can I use query strings to specify parameters in RESTXQ? What if I want URLs like this:
/api/dictionary/?lemma=cheese
Thanks!
Jonathan