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

76 lines
6.7 KiB
HTML

<!--
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헤더를 지정합니다.</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>
</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>리퀘스트가 1번이상 리다이렉트된 경우, 프로퍼티에 정보가 축적됩니다. `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>