Comment Update
수정하고자 하는 Comment의 pk값을 받아서 Comment object를 update합니다.
URL
/post/comment/<pk>/
Method
PUT
Input data
Key | Description | Value | Type | Require |
---|---|---|---|---|
content | comment의 내용 | comment's content | String | True |
Success Response
HTTP Status Code
201
content
{
"pk": 4,
"post": 1,
"author": {
"pk": 1,
"email": "[email protected]",
"nickname": "admin",
"username": "",
"profile_img": "http://localhost:8000/static/images/no_profile.png"
},
"content": "comment create test",
"created_date": "2017-08-11T10:39:52.943917Z"
}
Error response
Content error
HTTP Status code
400
Content
# request.data에 content가 없는 경우
{
"content": [
"이 항목을 채워주십시오."
]
}
# content가 빈 값인 경우
{
"content": [
"이 칸은 blank일 수 없습니다."
]
}
Unauthorized error
HTTP Status code401
Content
{
"detail": "자격 인증데이터(authentication credentials)가 제공되지 않았습니다."
}
Request user is not comment's author error
HTTP Status code403
Content
{
"detail": "작성자만 요청할 수 있는 작업입니다."
}
Comment does not exist error
HTTP Status code404
Content
{
"detail": "찾을 수 없습니다."
}