[PyWPS-dev] json requests return utf-8 encoded strings :(

Carsten Ehbrecht ehbrecht at dkrz.de
Mon Sep 3 01:47:04 PDT 2018


Hi Martin,

I usually return json files as reference, so I can avoid this. I haven’t checked how the correct way of returning data within the WPS response should be. You could open an issue for this on GitHub.

See also: http://geoprocessing.info/wpsdoc/1x0Execute <http://geoprocessing.info/wpsdoc/1x0Execute> 

Cheers,
Carsten

> On 29. Aug 2018, at 21:24, Martin Paredes <MParedes at dzynetech.com> wrote:
> 
> Anytime I request data as json I receive back a html escaped (utf-8) string. It seems that because the data is already in 
>     <![CDATA[
> there should be no need to convert each " to " as it's just making the data so much larger.
> What can I do to set the json to be returned as a regular ascii string? Is there a configuration setting, or do I need to modify the pywps code and rebuld (if so, could you point me to what I need to modify please)?
> I've tried changing the pywps.cfg​ like so:
> 
> [server]
> encoding=iso-8859-1​
> 
> This happens with the default example testjson
> example (I didn't change anything, it was run straight from the code downloaded from github). Instead of getting back:    ​
> 
> <wps:ComplexData mimeType="application/geojson" encoding="" schema=""><![CDATA[
>                     ["foo", {"bar":["baz", null, 1.0, 2]}]
>  ]]></wps:ComplexData>
> 
> I'm getting:
> 
> <wps:ComplexData mimeType="application/geojson" encoding="" schema=""><![CDATA[
>                             [
>   "foo", 
>   {
>     "bar": [
>       "baz", 
>       null, 
>       1.0, 
>       2
>     ]
>   }
> ]
> ]]></wps:ComplexData>
> 
> 
> 
> Martin Paredes
> DZYNE Technologies
> Desk: 703.291.6662
> Mobile: 202.251.7655
> mparedes at dzynetech.com <mailto:mparedes at dzynetech.com>
> 
> _______________________________________________
> pywps-dev mailing list
> pywps-dev at lists.osgeo.org <mailto:pywps-dev at lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/pywps-dev <https://lists.osgeo.org/mailman/listinfo/pywps-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pywps-dev/attachments/20180903/b2c14ffe/attachment.html>


More information about the pywps-dev mailing list