重要
翻訳は あなたが参加できる コミュニティの取り組みです。このページは現在 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 |
ファイルのダウンロード先 |
|
[文字列] デフォルト: |
ファイルの保存先の指定。次のいずれかです:
|
詳細パラメータ
ラベル |
名前 |
データ型 |
説明 |
---|---|---|---|
方法 |
|
[列挙型] デフォルト: 0 |
リクエストに使うHTTPメソッド。選択肢は:
|
Data オプション |
|
[文字列] |
リクエストが POSTの場合に本体に加えるデータ。 |
出力
ラベル |
名前 |
データ型 |
説明 |
---|---|---|---|
ファイルのダウンロード先 |
|
[文字列] |
ダウンロードしたファイルの保存場所 |
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 |
|
[文字列] |
The URL or path of the file to open. |
方法 |
|
[列挙型] デフォルト: 0 |
リクエストに使うHTTPメソッド。選択肢は:
|
POST Data オプション |
|
[文字列] |
リクエストが POSTの場合に本体に加えるデータ。 |
Authentication オプション |
|
[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. |
ファイルのダウンロード先 オプション |
|
[文字列] Default: |
The result can be written to a file instead of being returned as a string. Specification of the file destination. One of:
|
出力
ラベル |
名前 |
データ型 |
説明 |
---|---|---|---|
ファイルのダウンロード先 |
|
[file] |
The downloaded file with the returned result |
HTTP Status |
|
[文字列] |
The HTTP Status |
Network error code |
|
[文字列] |
The error code when it fails (like as well on 404 HTTP Status etc.) |
Network error message |
|
[文字列] |
A string containing the error message in case of failure |
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 |
|
[文字列] |
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 コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。