Postman(4)
-
What is API (Application programming interface)?
API is the acronym for application programming interface — a software intermediary that allows two applications to talk to each other. APIs are an accessible way to extract and share data within and across organizations. APIs are all around us. https://www.mulesoft.com/resources/api/what-is-an-api#:~:text=API%20is%20the%20acronym%20for,APIs%20are%20all%20around%20us. What is an API? (Application..
2023.10.22 -
[Django] Postman - followings/followers serializers 설정
Postman 에서 followers의 정보를 보여주는 방법 1) id 번호로 followers가 누군지 보여주는 방법 -> PrimaryKeyRelatedField 사용 @users - serializers.py @postman 2) email로 followers가 누군지 보여주는 법 -> StringRelatedField 사용 이번에는 followings도 똑같이 이메일로 확인할 수 있게끔 설정했다. @users - serializers.py @postman
2023.10.04 -
[Django] Postman - refresh token 이용해서 login 하기
settings.py 에 token 설정을 하는 것까지 했다. 여기에서 access token 과 refresh token 의 사용주기를 정해놓는데, 이 사용주기가 끝나면 더이상 토큰이 유효하지 않다고 나온다. 나는 유효기간을 아~주 넉넉히 30일로 설정해놓았는데, 이 주기는 개발할때는 길게 해놓았다가 배포할때에는 예를들면 분 단위등으로 다시 설정해주면 된다. 연휴를 보내고 오니 내 토큰이 다 만료가 되어서 아래 방법들과 같이 refresh token 설정을 했다. 먼저 원래 로그인 해놓았던 refresh token을 복사한다. login requet를 복사해서 새로운 request를 만들고, body 창에 {"refresh" = ""} 을 작성하고 send 한다. 그럼 새로운 access token 이..
2023.10.02 -
[Django] postman 이용하여 수정하기 API 만들기
Postman을 이용하여 API 를 만들고 있다. 다음은 API로 수정하는 방법이다. 1. articles list 에서 게시글을 쓴 유저의 이메일을 확인 (또는 db로 확인) 2. login 에서 "access" 키 복사해서 environment - Initial value, Current value 에 저장 3. put 으로 설정한 후 주소창에 수정하려 하는 article number 입력 4. 내용 수정 *request 실행전 environment 설정 되어 있는지 꼭 확인*
2023.09.25