node-red/packages/node_modules/@node-red/nodes/locales/ja/network/21-httprequest.html

78 lines
7.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/html" data-help-name="http request">
<p>HTTPリクエストを送信しレスポンスを返します</p>
<h3>入力</h3>
<dl class="message-properties">
<dt class="optional">url <span class="property-type">文字列</span></dt>
<dd>ノードの設定で指定していない場合このプロパティでリクエストのurlを設定します</dd>
<dt class="optional">method <span class="property-type">文字列</span></dt>
<dd>ノードの設定で指定していない場合このプロパティでリクエストに用いるHTTPメソッドを設定します<code>GET</code>, <code>PUT</code>, <code>POST</code>, <code>PATCH</code>, <code>DELETE</code></dd>
<dt class="optional">headers <span class="property-type">オブジェクト</span></dt>
<dd>リクエストのHTTPヘッダを指定します注釈: <code>msg.headers</code></dd>
<dt class="optional">cookies <span class="property-type">オブジェクト</span></dt>
<dd>設定するとリクエストと共にクッキーを送ることができます</dd>
<dt class="optional">payload</dt>
<dd>リクエストボディとして送るデータ</dd>
<dt class="optional">rejectUnauthorized</dt>
<dd><code>false</code>使https</dd>
<dt class="optional">followRedirects</dt>
<dd><code>false</code><code>true</code></dd>
<dt class="optional">requestTimeout</dt>
<dd>正のミリ秒数をセットすると グローバルに設定された<code>httpRequestTimeout</code></dd>
</dl>
<h3>出力</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">文字列 | オブジェクト | バッファ</span></dt>
<dd>レスポンスボディ返却するボディデータを文字列JSON文字列として解釈した結果バイナリバッファのままのいずれにするかをノード設定により指定できます</dd>
<dt>statusCode <span class="property-type">数値</span></dt>
<dd>レスポンスのステータスコードもしくはリクエストが完了しなかった場合のエラーコード</dd>
<dt>headers <span class="property-type">オブジェクト</span></dt>
<dd>レスポンスヘッダを含むオブジェクト</dd>
<dt>responseUrl <span class="property-type">文字列</span></dt>
<dd>リクエストの処理時にリダイレクトが発生した場合このプロパティが最後にリダイレクトされたURLを表しますリダイレクトが起こらなかった場合最初リクエストのURLを表します</dd>
<dt>responseCookies <span class="property-type">オブジェクト</span></dt>
<dd>レスポンスがクッキーを含む場合このプロパティは各クッキーの名前/値を含むオブジェクトを表します</dd>
<dt>redirectList <span class="property-type">配列</span></dt>
<dd>リクエストが一回以上リダイレクトされた場合はこのプロパティに情報が蓄積されます`location`リダイレクト先を示します`cookies`リダイレクト元から返されたクッキー情報です</dd>
</dl>
<h3>詳細</h3>
<p>ードの設定でurlプロパティを指定する場合<a href="http://mustache.github.io/mustache.5.html" target="_blank">mustache形式</a>のタグを含めることができます。これにより、URLを入力メッセージの値から構成することができます。例えば、urlが<code>example.com/{{{topic}}}</code><code>msg.topic</code>{{{...}}}使/&mustache</p>
<p><b></b>: proxy<code>http_proxy=...</code>Node-RED</p>
<h4>複数のHTTPリクエストードの利用</h4>
<p>同一フローで本ノードを複数利用するためには<code>msg.headers</code><code>msg.headers</code>2<code>msg.headers</code><code>{}</code>
<h4>クッキーの扱い</h4>
<p>ノードに<code>cookies</code>/<code>value</code></p>
<p>リクエストに対して返却されたクッキーは<code>responseCookies</code></p>
<h4>要素タイプの扱い</h4>
<p><code>msg.payload</code><code>msg.payload</code>JSON</p>
<p>リクエストをフォームデータにエンコードするには<code>msg.headers["content-type"]</code><code>application/x-www-form-urlencoded</code></p>
<h4>ファイルのアップロード</h4>
<p><code>msg.headers["content-type"]</code><code>multipart/form-data</code><code>msg.payload</code>:</p>
<pre><code>{
"KEY": {
"value": FILE_CONTENTS,
"options": {
"filename": "FILENAME"
}
}
}</code></pre>
<p><code>KEY</code>, <code>FILE_CONTENTS</code> <code>FILENAME</code></p>
</script>