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

82 lines
6.0 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 in">
<p>HTTPエンドポイントを作成しWebサービスを構成します</p>
<h3>出力</h3>
<dl class="message-properties">
<dt>payload</dt>
<dd>GETリクエストの場合クエリパラメータからなるオブジェクトそれ以外の場合HTTPリクエストの本体を指します</dd>
<dt>req<span class="property-type">オブジェクト</span></dt>
<dd>HTTPリクエストオブジェクトオブジェクトはリクエストの情報に関する複数のプロパティを含みます
<ul>
<li><code>body</code> - </li>
<li><code>headers</code> - HTTP</li>
<li><code>query</code> - </li>
<li><code>params</code> - </li>
<li><code>cookies</code> - </li>
<li><code>files</code> - POST</li>
</ul>
</dd>
<dt>res<span class="property-type">オブジェクト</span></dt>
<dd>HTTPレスポンスオブジェクトこのプロパティを直接利用することは推奨しませんリクエストの処理方法については<code>HTTP Response</code>response</dd>
</dl>
<h3>詳細</h3>
<p>このノードは設定で指定したパスとリクエスト種別でリクエストを待ち受けますパス指定は完全に指定する形式(: <code>/user</code>)(: <code>/user/:name</code>)<code>msg.req.params</code></p>
<p>POSTやPUTのようにリクエストボディを含むリクエストの場合リクエストの内容は<code>msg.payload</code></p>
<p>リクエストの要素タイプが識別可能な場合にはリクエストボディを適切な形式に変換します例えば<code>application/json</code>JavaScript</p>
<p><b>:</b> HTTP Response</p>
</script>
<script type="text/html" data-help-name="http response">
<p>HTTP Inードで受け付けたリクエストに対するレスポンスを送り返します</p>
<h3>入力</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">文字列</span></dt>
<dd>レスポンス本体</dd>
<dt class="optional">statusCode <span class="property-type">数値</span></dt>
<dd>設定するとレスポンスのステータスコードとしますデフォルト: 200</dd>
<dt class="optional">headers <span class="property-type">オブジェクト</span></dt>
<dd>設定するとレスポンスのHTTPヘッダとします</dd>
<dt class="optional">cookies <span class="property-type">オブジェクト</span></dt>
<dd>設定するとクッキーを設定もしくは削除するために使用します</dd>
</dl>
<h3>詳細</h3>
<p><code>statusCode</code><code>headers</code>使</p>
<h4>クッキーの処理</h4>
<p><code>cookies</code>/使</p>
<p>以下の例では2つのクッキーを設定しています1つ目は<code>name</code><code>nick</code>2<code>session</code><code>1234</code>15</p>
<pre>
msg.cookies = {
name: 'nick',
session: {
value: '1234',
maxAge: 900000
}
}</pre>
<p>有効なオプションには以下があります</p>
<ul>
<li><code>domain</code> - () </li>
<li><code>expires</code> - () GMT0</li>
<li><code>maxAge</code> - () </li>
<li><code>path</code> - (文字列) クッキーのパス。デフォルトは「/</li>
<li><code>value</code> - () </li>
</ul>
<p>クッキーを削除するには<code>value</code><code>null</code></p>
</script>