Scrap API
1. 게시글 스크랩
Request
PUT /api/v1/scraps/4236 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0Ml9qaG91c2VfY29tIiwiZXhwIjoxNzExMzcwNDcyLCJhdXRoIjoiVVNFUiIsInR5cGUiOiJOT05FIn0.wMR8XviDDJwO9hEXOlmrklA_5jKYPtFUj2z16bpVY0F2CQVZbCpyrKlOgq-9tTKqn4wU3OwXHzTTshMtvvgzGQ
Accept: application/json
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 65
{
"code" : "SUCCESS",
"message" : "성공",
"data" : 4236
}
2. 이미 스크랩한 게시글인 경우
Request
PUT /api/v1/scraps/4234 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0Ml9qaG91c2VfY29tIiwiZXhwIjoxNzExMzcwNDcyLCJhdXRoIjoiVVNFUiIsInR5cGUiOiJOT05FIn0.wMR8XviDDJwO9hEXOlmrklA_5jKYPtFUj2z16bpVY0F2CQVZbCpyrKlOgq-9tTKqn4wU3OwXHzTTshMtvvgzGQ
Accept: application/json
Host: localhost:8080
Response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 79
{
"code" : "H0002",
"message" : "이미 스크랩한 게시글입니다."
}
3. 게시글 스크랩 해제
Request
DELETE /api/v1/scraps/4235 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0Ml9qaG91c2VfY29tIiwiZXhwIjoxNzExMzcwNDcyLCJhdXRoIjoiVVNFUiIsInR5cGUiOiJOT05FIn0.wMR8XviDDJwO9hEXOlmrklA_5jKYPtFUj2z16bpVY0F2CQVZbCpyrKlOgq-9tTKqn4wU3OwXHzTTshMtvvgzGQ
Accept: application/json
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 48
{
"code" : "SUCCESS",
"message" : "성공"
}