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

82 lines
5.7 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> - () GMT . 0 , </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>