Fetch (API)

차노·2023년 8월 4일
0

JS

목록 보기
22/96

사전적 의미:

go for and then bring back (someone or something) for someone.

가져오다, 취하다...
뎨이터를 회수하다(가져오다)

Fetch API는 reqeust와 response 객체를 사용한다. 소스를 요청하고 fetch하기 위해서는, fetch() method를 활용해야 한다. 이는 윈도우 상에서 전역 메소드이며, 대부분의 컨텍스트에 접근이 가능하다.

The fetch() returns a promise that resolves to the Response to the request.

fetch()는 요청에 응답을 할 수 있는 Promise keyword를 반환한다.

Once a Request is retired, there are a number of method available to define what the body content is and how it should be handled.

Request(요청)가 회수가 되면, 바디 컨텐트인 것을 정의 할 수 있는 수 많은 메소드가 있으며, 이를 어떻게 활용할 지가 중요하다

You can create a request and response directly using the Request() and Response() constructors.

The Fetch API provides a JavaScript interface for accessing and manipulating parts of the protocol, such as reqeusts and responses. It also provides a global fetch() method that provides an easy, logical way to fetch resource asynchronously across the network.

패치 API는 request, response와 같은 프로토콜의 부분들에 접근하고 조작하는 자바스크립트 인터페이스를 제공한다. 네트워크 상에서 비동기적으로 자원을 가져오는 논리적이고 쉬운 방법을 제공하는 전역 패치를 제공한다.

Fetch is promise-based and provides a better alternative that can be easily used in service workers.

패치는 서비스 워커에서 쉽게 사용되는 나은 대안을 제공하는 프라미스 기반의 함수이다.

Reference

fetch는 특정 서버로부터 데이터를 가져와 reqeust 객체에 저장한다.

transitive verb
to go or come after and bring or take back.

가져오다; 되찾다

to cause to come

일어나게 하다; 만들다

Reference

0개의 댓글