개인 프로젝트(2)
-
Django (Django RestFramework)와 multipart/form-data의 관계
Django로 multipart/form-data의 형태로 자료를 전달하려고 한다. 해당 Request는 Postman을 이용하였다. Request는 String, List, image를 다 포함하고있다. 파일첨부는 multipart/form-data형태로만 전달되기 때문에, 해당 Content-Type으로 보내기로 했다. String 형태는 자연스럽게 문제없이 진행되었다. List형태는 rawData형태로 보낼 당시 ["리스트 값", "리스트 값", ... ] 형태와는 다르게, multipart/form-data에서는 key값을 여러번 주어서 리스트로 전달될 수 있었다. 기존 raw 데이터와는 다르게, dict형태가 아닌 QueryDict라는 객체로 들어오는 것을 확인할 수 있다. multipart/f..
2021.09.09 -
[쇼빌리티] 모델링 중
모든 컨텐츠(allContents) { "pk": "userId:Category:filePk", "filePk": "", "representImage": "", "category": "", "tag": ["tag1", "tag2", "tag3"], "userId": "", "uploadDate": "", "groupId": "", "likers": [{ "AnotherId1": true, "AnotherId2": true }], "viewCount": "" } 팔로워/팔로잉 { "users": [{ "userID": "MyId1", "followers": [{ "followerUserID": "AnotherPersonId1", "profileImage": "imagePath" }, { "followerU..
2020.12.01