GET request serialization options
Tuesday, 29 April 2014 · 4 messages
MR
Martin Reckziegel29 Apr 2014 11:03 #
Hello all,
i'm trying to get the result of a REST GET query as json. Setting just the GET parameter 'method=json' doesn't work since i don't have a <json> root node.
How do I specify the JSON Module options
(http://docs.basex.org/wiki/JSON_Module) as GET parameters? The parameter 'format' seems to be reserved by some other module since it only allows 'yes' or 'no' as value. I want to set format=jsonml since then I can export any xml result as json.
Is this possible with a GET request?
thanks in advance
Martin
CG
Christian Grün29 Apr 2014 11:15 #
Hi Martin,
I have added the following example..
http://localhost:8984/factbook/factbook.xml?method=json&json=format=jsonml
in our Wiki:
http://docs.basex.org/wiki/REST#GET_Requests
Hope this helps,
Christian
Quoted text · Martin Reckziegel · 18 lines
On Tue, Apr 29, 2014 at 11:03 AM, Martin Reckziegel < reckziegel at informatik.uni-leipzig.de> wrote: > Hello all, > > i'm trying to get the result of a REST GET query as json. Setting just the > GET parameter 'method=json' doesn't work since i don't have a <json> root > node. > How do I specify the JSON Module options (http://docs.basex.org/wiki/ > JSON_Module) as GET parameters? The parameter 'format' seems to be > reserved by some other module since it only allows 'yes' or 'no' as value. > I want to set format=jsonml since then I can export any xml result as json. > Is this possible with a GET request? > > thanks in advance > Martin > > >
MR
Martin Reckziegel29 Apr 2014 13:45 #
thanks alot, this does the trick.
Just out of curiousity: how would I specify more than one option for the json module:
http://localhost:8984/factbook/factbook.xml?method=json&json=format=jsonml&json=lax=yes doesn't make sense syntactically right?
greetings
Martin
Quoted text · Christian Grün · 36 lines
On 29.04.2014 11:15, Christian Grün wrote: > Hi Martin, > > I have added the following example.. > > http://localhost:8984/factbook/factbook.xml?method=json&json=format=jsonml > > in our Wiki: > > http://docs.basex.org/wiki/REST#GET_Requests > > Hope this helps, > Christian > > > On Tue, Apr 29, 2014 at 11:03 AM, Martin Reckziegel > <reckziegel at informatik.uni-leipzig.de > <mailto:reckziegel at informatik.uni-leipzig.de>> wrote: > > Hello all, > > i'm trying to get the result of a REST GET query as json. Setting > just the GET parameter 'method=json' doesn't work since i don't > have a <json> root node. > How do I specify the JSON Module options > (http://docs.basex.org/wiki/JSON_Module) as GET parameters? The > parameter 'format' seems to be reserved by some other module since > it only allows 'yes' or 'no' as value. I want to set format=jsonml > since then I can export any xml result as json. > Is this possible with a GET request? > > thanks in advance > Martin > > >
DK
Dirk Kirsten29 Apr 2014 13:53 #
Dear Martin,
you can separate them using a comman, like so:
http://localhost:8984/factbook/factbook.xml?method=json&json=format=jsonml,lax=yes
Cheers,
Dirk
Quoted text · Martin Reckziegel · 52 lines
On 29/04/14 13:45, Martin Reckziegel wrote: > thanks alot, this does the trick. > > Just out of curiousity: how would I specify more than one option for the > json module: > http://localhost:8984/factbook/factbook.xml?method=json&json=format=jsonml&json=lax=yes > > doesn't make sense syntactically right? > > greetings > Martin > > > On 29.04.2014 11:15, Christian Grün wrote: >> Hi Martin, >> >> I have added the following example.. >> >> http://localhost:8984/factbook/factbook.xml?method=json&json=format=jsonml >> >> >> in our Wiki: >> >> http://docs.basex.org/wiki/REST#GET_Requests >> >> Hope this helps, >> Christian >> >> >> On Tue, Apr 29, 2014 at 11:03 AM, Martin Reckziegel >> <reckziegel at informatik.uni-leipzig.de >> <mailto:reckziegel at informatik.uni-leipzig.de>> wrote: >> >> Hello all, >> >> i'm trying to get the result of a REST GET query as json. Setting >> just the GET parameter 'method=json' doesn't work since i don't >> have a <json> root node. >> How do I specify the JSON Module options >> (http://docs.basex.org/wiki/JSON_Module) as GET parameters? The >> parameter 'format' seems to be reserved by some other module since >> it only allows 'yes' or 'no' as value. I want to set format=jsonml >> since then I can export any xml result as json. >> Is this possible with a GET request? >> >> thanks in advance >> Martin >> >> >> > >
--
Dirk Kirsten, BaseX GmbH, http://basex.org
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
| Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
Written for BaseX 7.8. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery