You can have a look to
https://qgis.org/pyqgis/3.2/core/File/QgsFileDownloader.html , store the
contents to a temporary file and then load it.

... or also
https://qgis.org/pyqgis/3.2/core/Network/QgsNetworkContentFetcher.html?highlight=fetcher#module-QgsNetworkContentFetcher

Both classes handle QGIS authentication configurations and proxies, OAuth2
is also supported by both.



On Wed, Jun 24, 2020 at 1:37 PM Karl Magnus Jönsson <
karl-magnus.jons...@kristianstad.se> wrote:

> Hi!
>
> I’m also interested this functionality. Need to use OAuht2 authentication
> but that seems not to be available. Guess there is just an solution
> programmatically then.
>
>
>
> *Karl-Magnus*
>
>
>
> *Från:* Qgis-user <qgis-user-boun...@lists.osgeo.org> *För *Ben Hur Pintor
> *Skickat:* den 24 juni 2020 10:23
> *Till:* Steve Sgalowski <steve.sgalow...@gmail.com>
> *Kopia:* QGIS User <Qgis-user@lists.osgeo.org>
> *Ämne:* Re: [Qgis-user] Http access to json return
>
>
>
> Hi!
>
>
>
> If it's a vector layer (e.g. geojson response) that you'll load via API,
> you can try using the Data Source Manager -> Vector Tab and use *Protocol:
> HTTP(S), cloud, etc.*. You can select the proper *Type* and input the
> *URI* similar to the image below. This will load the file/response as a
> QGIS layer.
>
>
>
>
>
> I haven't tried it yet for CSV / non-spatial data though.
>
>
>
> All the best,
>
> Ben Hur
>
>
>
> On Wed, Jun 24, 2020 at 2:23 PM Andreas Neumann <a.neum...@carto.net>
> wrote:
>
> Hi Steve,
>
> Not that I know of, but:
>
> - you could have an onload Python script that runs when the form opens
>
> - you could have a web-widget with an onload javascript that does some
> network requests
>
> Such rather "developer centric" questions are more likely to get responses
> on the qgis-developer mailing lists, btw.
>
> Greetings,
>
> Andreas
>
> On 2020-06-24 07:22, Steve Sgalowski wrote:
>
> Is there  widget  on qgis that does http out with api and returns data in
> json or csv format?.
>
>
>
> Stephen.
>
>
>
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>
>
> --
>
> ---
>
> *Ben Hur S. Pintor*
>
> bnhr.xyz
>
> h...@bnhr.xyz
>
>
>
> open spatial & data solutions
> _______________________________________________
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user



-- 
Alessandro Pasotti
QCooperative:  www.qcooperative.net
ItOpen:   www.itopen.it
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to