<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
And I finally discovered that I can load my geojson webservice in
QGIS from Python :<br>
<br>
<font size="2" face="Courier New, Courier, monospace">myLayer=
QgsVectorLayer('<a class="moz-txt-link-freetext" href="http://mydomain:3000/rpc/wod_geojson">http://mydomain:3000/rpc/wod_geojson</a>, 'myLayer',
'ogr')<br>
QgsProject.instance().addMapLayers([myLayer])</font><br>
<br>
But still not from QGIS UI...<br>
<pre class="moz-signature" cols="72">--
Christophe Damour
</pre>
<div class="moz-cite-prefix">Le 15/02/2022 à 10:38, SIGéal a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:8109be5d-6539-b758-aad7-81c601da3f51@sigeal.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
I managed to have ogrinfo working by adding "Accept:
application/json" header using <span lang="EN-US">GDAL_HTTP_HEADER_FILE.<br>
<br>
Now the problem is I can't do that with QGIS...<br>
<br>
</span>
<pre class="moz-signature" cols="72">--
Christophe Damour
</pre>
<div class="moz-cite-prefix">Le 15/02/2022 à 08:46, Rahkonen Jukka
(MML) a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:382ff75e57654d9aa9d9962e23b41f34@maanmittauslaitos.fi">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:"Calibri Light";
panose-1:2 15 3 2 2 2 4 3 2 4;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}span.Shkpostityyli26
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">I wonder if there
could be something in the Accept headers that orginfo is
using. Ogrinfo seems to set headers “Accept: text/plain,
application/json” but GeoJSON is now officially
“application/geo+json”. I do not know the hierarchy of the
MIME types and if “json” should include also the subtype
“geo+json”.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I made a test with
ogrinfo and --config GDAL_HTTP_HEADER_FILE
my_headers.txt. After this I could see from the logs this<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Accept:
application/geo+json<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Accept: text/plain,
application/json<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">By <a
href="https://datatracker.ietf.org/doc/html/rfc2616/"
moz-do-not-send="true" class="moz-txt-link-freetext">
https://datatracker.ietf.org/doc/html/rfc2616/</a> I
suppose this is correct and http server should concatenate
Accept headers. However, the test was not successful so
maybe there is something else going wrong.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>