{
"error": {
"code": "401",
"message": "엑세스 토큰이 만료 되었습니다."
}
}
예시)
- Date
const today = new Date();
- 사용시 request
"date": today.ISOString()
- 사용시 response
const dateString = "2022-01-01T12:00:00Z";
const date = new Date(dateString);
console.log(date); // 출력: Sat Jan 01 2022 21:00:00 GMT+0900 (한국 표준시)
# Request
- 예시
HTTP Method: GET
URL: https://[경로미정]/info/{uid}?type=[type]&일자=[date]
Headers:
Authorization: Bearer {token} //헤더에 엑세스 토큰 보내주세요 !
Content-Type: application/json
- body
{
"diet": {
"date": today.ISOString()
}
}
[Springboot] Custom exception 설정하기
# Response
- 성공 200 || 201
{
"diet_id" : 101
}
- 실패 그외
{
"error": {
"code": "INVALID_REQUEST",
"message": "등록에 실패했습니다." //client화면에서 사용할 err메세지
}
}