SyntaxHighlighter.all();

Notice
Recent Posts
Recent Comments
Link
«   2025/08   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Archives
Total
Today
Yesterday
관리 메뉴

Ajac in React, Fetch, promise 본문

ReactJS

Ajac in React, Fetch, promise

데브케이션 2018. 11. 3. 16:05

Ajax(Asynchronous JavaScript and XML)

비동기 데이터 교환



Fetch   (React Native Doc)




fetch( 'https://mywebsite.com/mydata.json' );



임의의 URL에서 콘텐츠를 가져오려면 URL fetch에 전달




fetch('https://mywebsite.com/endpoint/', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
firstParam: 'yourValue',
secondParam: 'yourOtherValue',
}),
});



HTTP 요청을  사용자 정의  . 추가 헤더를 지정하거나 POST 요청을 할 수 있음.



'ReactJS' 카테고리의 다른 글

Component State  (0) 2018.10.30
Component Life Cycle  (0) 2018.10.30
컴포넌트 , Props  (0) 2018.10.30
ReactJS 설치  (0) 2018.10.29
Comments