重要

翻訳は あなたが参加できる コミュニティの取り組みです。このページは現在 70.80% 翻訳されています。

24.1.4. ファイルツール

24.1.4.1. Download file via HTTP(S)

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

パラメータ

基本パラメータ

ラベル

名前

データ型

説明

URL

URL

[文字列]

ダウンロードしたいファイルのURL

ファイルのダウンロード先

OUTPUT

[文字列]

デフォルト: [一時ファイルに保存]

ファイルの保存先の指定。次のいずれかです:

  • 一時ファイルに保存

  • ファイルに保存...

詳細パラメータ

ラベル

名前

データ型

説明

方法

METHOD

[列挙型]

デフォルト: 0

リクエストに使うHTTPメソッド。選択肢は:

  • 0 --- GET

  • 1 --- POST

Data

オプション

DATA

[文字列]

リクエストが POSTの場合に本体に加えるデータ。

出力

ラベル

名前

データ型

説明

ファイルのダウンロード先

OUTPUT

[文字列]

ダウンロードしたファイルの保存場所

Python コード

Algorithm ID: qgis:filedownloader

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

algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。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.

パラメータ

ラベル

名前

データ型

説明

URL or file path

URL

[文字列]

The URL or path of the file to open.

方法

METHOD

[列挙型]

デフォルト: 0

リクエストに使うHTTPメソッド。選択肢は:

  • 0 --- GET

  • 1 --- POST

POST Data

オプション

DATA

[文字列]

リクエストが POSTの場合に本体に加えるデータ。

Authentication

オプション

AUTH_CONFIG

[authconfig]

Default: No authentication

An authentication configuration to pass

Consider HTTP errors as failures

FAIL_ON_ERROR

[boolean]

Default: False

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

ファイルのダウンロード先

オプション

OUTPUT

[文字列]

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:

  • 出力をスキップ

  • 一時ファイルに保存

  • ファイルに保存...

出力

ラベル

名前

データ型

説明

ファイルのダウンロード先

OUTPUT

[file]

The downloaded file with the returned result

HTTP Status

STATUS_CODE

[文字列]

The HTTP Status

Network error code

ERROR_CODE

[文字列]

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

Network error message

ERROR_MESSAGE

[文字列]

A string containing the error message in case of failure

Result data

RESULT_DATA

[文字列]

A string containing the result data in case of success

Python コード

Algorithm ID: native:httprequest

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

algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。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.

パラメータ

ラベル

名前

データ型

説明

URL or file path

URL

[文字列]

The URL or path of the file to open.

出力

The algorithm has no output.

Python コード

Algorithm ID: native:openurl

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

algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。Python コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。