Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- 문자열처리
- node배포
- Local Search
- 철학
- lightsailor
- 컴퓨터공학
- CS
- node.js
- typescript
- Simulated Annealing
- AWS
- 코드
- Search Algorithm
- multer-s3
- 문자열
- computerscience
- 배포
- 알고리즘
- 파이썬
- 컴퓨터과학
- Hill Climbing
Archives
- Today
- Total
지식의모듈화
Axios get 본문
import axios from 'axios'
let object={};
while(Object.keys(object).length < 3){
try{
let res = await axios.get("https://api.kanye.rest")
// console.log(res.data)
object[res.data.quote]=(object[res.data.quote]||0)+1;
// console.log(res.data.quote)
}catch(error){console.log(error)};
}
console.log(Object.keys(object))
Axios를 활용하면 쉽게 get을 해올 수 있다. 서로 다른 3개의 kanye west의 명언을 fetch해오는 코드다
'Javascript' 카테고리의 다른 글
| [javascript] for ~ in, for ~ of (0) | 2022.06.23 |
|---|