diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
| commit | da78a9e329e272dedb2400b79a3bdeebff387d47 (patch) | |
| tree | e6ef8aa7c43556f55ddfe031a01cf0a8fa271bfe /files/ko/web/api/request/credentials | |
| parent | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (diff) | |
| download | translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.gz translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.bz2 translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.zip | |
initial commit
Diffstat (limited to 'files/ko/web/api/request/credentials')
| -rw-r--r-- | files/ko/web/api/request/credentials/index.html | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/files/ko/web/api/request/credentials/index.html b/files/ko/web/api/request/credentials/index.html new file mode 100644 index 0000000000..ed7186a6d9 --- /dev/null +++ b/files/ko/web/api/request/credentials/index.html @@ -0,0 +1,70 @@ +--- +title: Request.credentials +slug: Web/API/Request/credentials +tags: + - API + - Cookies + - Fetch + - Networking + - Property + - Reference + - Security + - credentials + - request +translation_of: Web/API/Request/credentials +--- +<div>{{APIRef("Fetch")}}</div> + +<p>{{domxref("Request")}} 인터페이스의 <strong><code>credentials</code></strong> 읽기 전용 속성은 cross-origin 요청의 경우, user agent가 다른 도메인으로부터 cookie 들을 전달해야만 하는가 아닌가를 나타낸다. 이것은 XHR 의 withCredentials flag 과 비슷하지만, (2개가 아니라) 3가지 값이 사용 가능하다 :</p> + +<ul> + <li><code>omit</code>: 절대로 cookie 들을 전송하거나 받지 않는다.</li> + <li><code>same-origin</code>: URL이 호출 script 와 동일 출처(same origin)에 있다면, user credentials (cookies, basic http auth 등..)을 전송한다. <strong>이것은 default 값이다.</strong></li> + <li><code>include</code>: cross-origin 호출이라 할지라도 언제나 user credentials (cookies, basic http auth 등..)을 전송한다.</li> +</ul> + +<h2 id="Syntax">Syntax</h2> + +<pre class="brush: js">var myCred = request.credentials;</pre> + +<h3 id="Value">Value</h3> + +<p>이 transaction에 사용할 credentials 를 나타내는 {{domxref("RequestCredentials")}} 값</p> + +<h2 id="Example">Example</h2> + +<p>다음의 snippet 에서, 우리는 {{domxref("Request.Request()")}} constructor 를 사용하여 (스크립트와 동일한 디렉토리의 이미지 파일을 위한) 새로운 요청(request)를 생성하고, 변수에 요청(request) credentials 을 저장한다.</p> + +<pre class="brush: js">var myRequest = new Request('flowers.jpg'); +var myCred = myRequest.credentials; // returns "same-origin" by default</pre> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('Fetch','#dom-request-credentials','credentials')}}</td> + <td>{{Spec2('Fetch')}}</td> + <td>Initial definition</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + + + +<p>{{Compat("api.Request.credentials")}}</p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="/en-US/docs/Web/API/ServiceWorker_API">ServiceWorker API</a></li> + <li><a href="/en-US/docs/Web/HTTP/Access_control_CORS">HTTP access control (CORS)</a></li> + <li><a href="/en-US/docs/Web/HTTP">HTTP</a></li> +</ul> |
