Importante
unireLa traduzione è uno sforzo comunitario you can join. Questa pagina è attualmente tradotta al 70.80%.
24.1.4. Strumenti file
24.1.4.1. Download file via HTTP(S)
Downloads a URL to the file system with an HTTP(S) GET or POST request.
Parametri
Parametri di Base
Etichetta |
Nome |
Tipo |
Descrizione |
---|---|---|---|
URL |
|
[stringa] |
L’URL del file da scaricare. |
Destinazione file |
|
[stringa] Predefinito: |
Indicazione della destinazione del file. Una di:
|
Parametri Avanzati
Etichetta |
Nome |
Tipo |
Descrizione |
---|---|---|---|
Method |
|
[enumeration] Predefinito: 0 |
Il metodo HTTP da utilizzare per la richiesta. Le opzioni sono:
|
Data Opzionale |
|
[stringa] |
I dati da aggiungere nel codice se la richiesta è di tipo POST. |
In uscita:
Etichetta |
Nome |
Tipo |
Descrizione |
---|---|---|---|
Destinazione file |
|
[stringa] |
La posizione del file scaricato |
Codice Python
ID algoritmo: qgis:filedownloader
import processing
processing.run("algorithm_id", {parameter_dictionary})
L” id dell’algoritmo viene visualizzato quando si passa il mouse sull’algoritmo nella finestra degli strumenti di elaborazione. Il dizionario dei parametri fornisce i Nomi e i valori dei parametri. Vedi Usare gli algoritmi di Processing dalla console dei comandi per dettagli su come eseguire algoritmi di elaborazione dalla console Python.
24.1.4.2. HTTP(S) POST/GET request
Performs a HTTP(S) POST/GET request and returns the HTTP status code and the reply data. If an error occurs then the error code and the message will be returned. Optionally, the result can be written to a file on the disk. By default the algorithm will warn on errors. Optionally, the algorithm can be set to treat HTTP errors as failures.
Parametri
Etichetta |
Nome |
Tipo |
Descrizione |
---|---|---|---|
URL or file path |
|
[stringa] |
The URL or path of the file to open. |
Method |
|
[enumeration] Predefinito: 0 |
Il metodo HTTP da utilizzare per la richiesta. Le opzioni sono:
|
POST Data Opzionale |
|
[stringa] |
I dati da aggiungere nel codice se la richiesta è di tipo POST. |
Authentication Opzionale |
|
[authconfig] Default: No authentication |
An authentication configuration to pass |
Consider HTTP errors as failures |
|
[boolean] Default: False |
If set, the algorithm will fail on encountering an HTTP error. |
Destinazione file Opzionale |
|
[stringa] Default: |
The result can be written to a file instead of being returned as a string. Specification of the file destination. One of:
|
In uscita:
Etichetta |
Nome |
Tipo |
Descrizione |
---|---|---|---|
Destinazione file |
|
[file] |
The downloaded file with the returned result |
HTTP Status |
|
[stringa] |
The HTTP Status |
Network error code |
|
[stringa] |
The error code when it fails (like as well on 404 HTTP Status etc.) |
Network error message |
|
[stringa] |
A string containing the error message in case of failure |
Result data |
|
[stringa] |
A string containing the result data in case of success |
Codice Python
Algorithm ID: native:httprequest
import processing
processing.run("algorithm_id", {parameter_dictionary})
L” id dell’algoritmo viene visualizzato quando si passa il mouse sull’algoritmo nella finestra degli strumenti di elaborazione. Il dizionario dei parametri fornisce i Nomi e i valori dei parametri. Vedi Usare gli algoritmi di Processing dalla console dei comandi per dettagli su come eseguire algoritmi di elaborazione dalla console Python.
24.1.4.3. Open file or URL
Opens files in their default associated application, or URLs in the user’s default web browser.
Parametri
Etichetta |
Nome |
Tipo |
Descrizione |
---|---|---|---|
URL or file path |
|
[stringa] |
The URL or path of the file to open. |
In uscita:
The algorithm has no output.
Codice Python
Algorithm ID: native:openurl
import processing
processing.run("algorithm_id", {parameter_dictionary})
L” id dell’algoritmo viene visualizzato quando si passa il mouse sull’algoritmo nella finestra degli strumenti di elaborazione. Il dizionario dei parametri fornisce i Nomi e i valori dei parametri. Vedi Usare gli algoritmi di Processing dalla console dei comandi per dettagli su come eseguire algoritmi di elaborazione dalla console Python.