Skip to Content
자바스크립트 완벽 가이드
book

자바스크립트 완벽 가이드

by David Flanagan, Han Seon- yong
February 2022
Beginner to intermediate
784 pages
24h 53m
Korean
Insight
Content preview from 자바스크립트 완벽 가이드
the De󼴩nitive Guide
593
15.11 네트워크
󺈟󼃷󽴔󼉫󼅧󽴔󻭣󼅼
fetch()
는 보통 웹 애플리케이션이 자신의 웹 서버에 데이터를 요청할 때 가장 많
이 사용합니다.
fetch()
에 전달되는 URL이 요청을 보내는 스크립트를 포함하는 문
서와 같은 출처(프로토콜, 호스트 이름, 포트)를 사용하므로 이런 요청을 동일 출처
요청이라 부릅니다.
웹 브라우저는 일반적으로 보안을 위해 교차 출처 네트워크 요청을 거부합니다.
(이미지와 스크립트는 대개 예외입니다.) 교차 출처간 자원 공유(CORS)를 사용하
면 교차 출처 요청도 안전하게 보낼 수 있습니다. 교차 출처 URL에
fetch()
를 사용
하면 브라우저는 요청에 Origin 헤더를 추가해서 (이 헤더는
headers
프로퍼티로
덮어 쓸 수 없습니다) 웹 서버에 요청이 다른 출처에서 온 것임을 알립니다. 서버가
적절한 Access-Control-Allow-Origin 헤더와 함께 요청에 응답하면 요청이 계속 수
행되지만, 그렇지 않고 서버에서 명시적으로 요청을 허용하지 않는다면
fetch()
가
반환하는 프라미스는 거부됩니다.
󻭣󼅼󽴔󼊷󻙛
사용자가 취소 버튼을 클릭하거나 요청이 너무 오랫동안 수행될 경우
fetch()
요청
을 취소해야 할 수도 있습니다. fetch API는 AbortController와 AbortSignal ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

개발자를 위한 필수 수학

개발자를 위한 필수 수학

토머스 닐드
개발 7년차, 매니저 1일차

개발 7년차, 매니저 1일차

권원상, 한민주, 카미유 푸르니에

Publisher Resources

ISBN: 9788966263462