Ważne

Tłumaczenie jest wysiłkiem społeczności QGISa przyłącz się. Ta strona jest obecnie przetłumaczona w 65.69%.

24.1.4. File tools

24.1.4.1. Download file via HTTP(S)

Downloads a URL to the file system with an HTTP(S) GET or POST request.

Parametry

Parametry podstawowe

Etykieta

Nazwa

Typ

Opis

URL

URL

[ciąg tekstowy]

The URL of the file to download.

File destination

OUTPUT

[ciąg tekstowy]

Domyślnie: [Zapisz do pliku tymczasowego]

Specification of the file destination. One of:

  • Zapisz do pliku tymczasowego

  • Zapisz do pliku…

Parametry zaawansowane

Etykieta

Nazwa

Typ

Opis

Metoda

METHOD

[wyliczenie]

Domyślnie: 0

The HTTP method to use for the request. Options are:

  • 0 — GET

  • 1 — POST

Dane

Opcjonalne

DATA

[ciąg tekstowy]

The data to add in the body if the request is a POST.

Wyniki

Etykieta

Nazwa

Typ

Opis

File destination

OUTPUT

[ciąg tekstowy]

The location of the downloaded file

Kod Pythona

ID algorytmu: qgis:filedownloader

import processing
processing.run("algorithm_id", {parameter_dictionary})

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Using processing algorithms from the console for details on how to run processing algorithms from the Python console.

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.

Parametry

Etykieta

Nazwa

Typ

Opis

URL or file path

URL

[ciąg tekstowy]

The URL or path of the file to open.

Metoda

METHOD

[wyliczenie]

Domyślnie: 0

The HTTP method to use for the request. Options are:

  • 0 — GET

  • 1 — POST

POST Data

Opcjonalne

DATA

[ciąg tekstowy]

The data to add in the body if the request is a POST.

Uwierzytelnianie

Opcjonalne

AUTH_CONFIG

[authconfig]

Default: No authentication

An authentication configuration to pass

Consider HTTP errors as failures

FAIL_ON_ERROR

[wartość logiczna]

Domyślnie: False

If set, the algorithm will fail on encountering an HTTP error.

File destination

Opcjonalne

OUTPUT

[ciąg tekstowy]

Default: [Skip Output]

The result can be written to a file instead of being returned as a string. Specification of the file destination. One of:

  • Pomiń wyjście

  • Zapisz do pliku tymczasowego

  • Zapisz do pliku…

Wyniki

Etykieta

Nazwa

Typ

Opis

File destination

OUTPUT

[plik]

The downloaded file with the returned result

HTTP Status

STATUS_CODE

[ciąg tekstowy]

The HTTP Status

Network error code

ERROR_CODE

[ciąg tekstowy]

The error code when it fails (like as well on 404 HTTP Status etc.)

Network error message

ERROR_MESSAGE

[ciąg tekstowy]

A string containing the error message in case of failure

Result data

RESULT_DATA

[ciąg tekstowy]

A string containing the result data in case of success

Kod Pythona

ID algorytmu: native:httprequest

import processing
processing.run("algorithm_id", {parameter_dictionary})

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Using processing algorithms from the console for details on how to run processing algorithms from the Python console.

24.1.4.3. Open file or URL

Opens files in their default associated application, or URLs in the user’s default web browser.

Parametry

Etykieta

Nazwa

Typ

Opis

URL or file path

URL

[ciąg tekstowy]

The URL or path of the file to open.

Wyniki

The algorithm has no output.

Kod Pythona

ID algorytmu: native:openurl

import processing
processing.run("algorithm_id", {parameter_dictionary})

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Using processing algorithms from the console for details on how to run processing algorithms from the Python console.