[OSM-dev] Fw: Malformed API results

Mike Parfitt m_parfitt at hotmail.com
Mon Jan 6 20:33:07 UTC 2020


I installed a packet sniffer app on my android tablet, then logged-in to osm, started the capture of packets and submitted the gpx_files api call.

The second response contained the XML tree as per the curl command with the <description>...</description> tag indented on a seperate line :-

<gpx_file id="..." name="..." user="..." visibility="..." pending="..." timestamp="..." lat="..." lon="...">
  <description>...</description>
</gpx_file>

It still seems odd that various Android and Windows apps would extract all of the <description>...</description> tag values and present them before the XML tree.

But it looks like they do.

Regards,

M
________________________________
From: Mike Parfitt <m_parfitt at hotmail.com>
Sent: 06 January 2020 12:16:26
To: mmd <mmd.osm at gmail.com>
Subject: Re: [OSM-dev] Malformed API results

The curl command you used looks very similar to the one generated for me by the app that I used unsuccessfully - probably because curl isn't installed on my tablet, or the command line app didn't know where to look.

Is it significant that the curl results contain

<?xml version="1.0" encoding="UTF-8"?>

before the start of the document tree, whereas the browser results have

This XML file does not appear to have any style information associated with it. The document tree is shown below.

It puzzles me that multiple non-curl tools on two different platforms would extract the contents of every <description> tag and put them ahead of the document tree in an identical manner.

Is it possible that curl discards anything that doesn't look like HTML/XML ?  That would explain why curl only shows the XML document tree.
________________________________
From: mmd <mmd.osm at gmail.com>
Sent: 04 January 2020 21:35:23
To: dev at openstreetmap.org <dev at openstreetmap.org>
Subject: Re: [OSM-dev] Malformed API results

On 2020-01-04 21:38, Mike Parfitt wrote:
> What does curl and wget return for you ?

Here's the result I got when running:
 curl https://api.openstreetmap.org/api/0.6/user/gpx_files -u
"some_osm_user_name"

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="OpenStreetMap server"
copyright="OpenStreetMap and contributors"
attribution="http://www.openstreetmap.org/copyright"
license="http://opendatacommons.org/licenses/odbl/1-0/">
<gpx_file id="..." name="..." user="..." visibility="private"
pending="false" timestamp="..." lat=".." lon="...">
  <description>...</description>
</gpx_file>
<gpx_file id="..." name="..." user="..." visibility="private"
pending="false" timestamp="..." lat=".." lon="...">
  <description>...</description>
</gpx_file>
<gpx_file id="..." name="..." user="..." visibility="private"
pending="false" timestamp="..." lat=".." lon="...">
  <description>...</description>
</gpx_file>
...
</osm>


You need to replace the user name with your own here, and provide a
password when curl asks you to. The result is an XML document with a
number of gpx_file elements. Note that I replaced some of the field
contents with dummy values above.


--




_______________________________________________
dev mailing list
dev at openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20200106/c0f83c75/attachment.htm>


More information about the dev mailing list