[ckan-discuss] qjson usage

David Read david.read at okfn.org
Fri Nov 4 10:34:32 GMT 2011


On 27 October 2011 15:18, Florian Marienfeld <
florian.marienfeld at fokus.fraunhofer.de> wrote:

> Hi,
>
> how do I correctly use the qjson param of the search api. I don't get it
> from the api doc. the straightforward approach would be:
>
> curl -s 'http://172.19.4.170/api/search/package?qjson={
> "maintainer":"joe"}'
>
> But that fives me
>    Could not read parameters: ValueError("Malformed qjson value:
> ValueError('Extra data: line 1 column 12 - line 1 column 18 (char 12 -
> 18)',)",)
>
> I've tried some variations of bracketing and escaping, but I am not
> getting it right. do I have do any urlencoding?
>

It seems that when using curl, the curly braces are being gobbled up by the
shell or curl, so need escaping. e.g.

$ curl 'http://thedatahub.org/api/search/dataset?qjson=\{
"author":"Stationery"\}'

And then it's clear that the url needs url encoding, so spaces come out as
%20. e.g.

$ curl 'http://thedatahub.org/api/search/dataset?qjson=\{
"author":"The%20Stationery%20Office%20Limited"\}'

I'll add these hints to the docs. Cheers for highlighting the issue,

David


> Any hints are welcome, thanks in advance, best regards,
>
> FLO
>
>
> --
> Florian Marienfeld
> Dipl.-Ing. Tech.-Inf.
>
> Fraunhofer FOKUS
> - CC Motion -
> Kaiserin-Augusta-Allee 31
> 10589 Berlin
> +49 30 3463 7127
>
>
> _______________________________________________
> ckan-discuss mailing list
> ckan-discuss at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-discuss/attachments/20111104/11793b4f/attachment.htm>


More information about the ckan-discuss mailing list