"Axios"의 두 판 사이의 차이

(새 문서: ==개요== ;Axios * 브라우저 및 node.js用 Promise 기반 HTTP 클라이언트 ==예시: GET 요청== <source lang='javascript'> axios.get('/user?ID=12345') .then(function (re...)
 
45번째 줄: 45번째 줄:


==참고==
==참고==
* {{위키백과}}
* https://github.com/axios/axios
* https://github.com/axios/axios


[[분류: Axios]]
[[분류: Axios]]

2017년 11월 15일 (수) 22:38 판

1 개요

Axios
  • 브라우저 및 node.js用 Promise 기반 HTTP 클라이언트

2 예시: GET 요청

axios.get('/user?ID=12345')
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });
axios.get('/user', {
    params: {
      ID: 12345
    }
  })
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });

3 예시: POST 요청

axios.post('/user', {
    firstName: 'Fred',
    lastName: 'Flintstone'
  })
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });

4 같이 보기

5 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}