일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 결정 알고리즘
- React
- 이분 검색
- CI/CD
- 리터럴 타입
- Promise
- CORS
- 투포인터
- tailwind
- useAppDispatch
- recoil
- dfs
- RTK Query
- 공변성
- app router
- ESlint
- SSR
- 무한 스크롤
- Cypress
- 인터섹션
- webpack
- TS
- 태그된 유니온
- Jest
- 타입 좁히기
- map
- 호이스팅
- async/await
- 반공변성
- autosize
Archives
- Today
- Total
목록formdata (1)
짧은코딩

이미지 전달법 프론트에서 이미지들을 서버에 전달하기 위해서는 formData에 담아서 전달해야 한다. 이 사진에 담긴 정보를 formData에 담아주면 된다. 사용법 const formData = new FormData(); images.forEach((image) => { formData.append('images', image.file as File); }); // 이미지 await axios.post(`/item/upload/${idx}/picture`, formData, { headers: { 'Content-Type': 'multipart/form-data', Authorization: `Bearer ${localStorage.getItem('accessToken')}`, }, }); 먼저 fo..
리액트
2023. 1. 15. 21:53