<p></p>
<h3 dir="auto">Description</h3>
<p dir="auto">Hello,</p>
<p dir="auto">I'm trying to load the content of a file with the osm api to display it in a web app, but I'm getting a 302 error.</p>
<p dir="auto"><code>TypeError: NetworkError when attempting to fetch resource. </code><br>
is it only possible to download the file and not just load the content of the file witrh .blob() ?</p>
<pre><code>
let osm_server_load_gpx = function (id) {
let n = "Bearer " + localStorage.getItem("openstreetmap_token");
const myHeaders = new Headers({
Authorization: n,
});
return fetch("https://api.openstreetmap.org/api/0.6/gpx/" + id + "/data", {
method: "GET",
headers: myHeaders,
redirect: "follow",
})
.then((response) => response.text())
.then((data) => {
console.log("data:" + data);
})
.catch((error) => {
alert("error: " + error);
});
};
</code></pre>
<h3 dir="auto">Screenshots</h3>
<p dir="auto"><em>No response</em></p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/3507">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLIHXINEVRJX5QVXYBDVBG6XXANCNFSM5RKZAJSA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPRX3DN6JDIV374XKTVBG6XXA5CNFSM5RKZAJSKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4RRDSLBQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/3507</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/3507",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/3507",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>