[TIL] fetch 함수를 이용한 회원가입 & 로그인구현

BINGBING🐨·2021년 6월 2일
0

Javascript

목록 보기
16/21

프론트엔드 로직

onclick을 하면 fetch로 보낸다.

Client Request-> Server (fetch함수 사용)
Server <-Response Client

fetch 함수

fetch("api주소",{
method:"Post",
body: JSON.stringify({
email: this.state.id, ->백엔드에서 원하는 키값으로.
password: this.state.pw,->백엔드에서 원하는 키값으로.
}),
})
.then((response) => response.join
.then((result) => console.log("결과: ", result)

같은 wifi 환경에서만 사용할 수 있다.

profile
iOS Developer

0개의 댓글