Skip to content

[POST] 게시글 작성

Suzie edited this page Nov 21, 2020 · 4 revisions

게시글 작성

METHOD PATH EXPLANATION
POST /posts 게시글 작성

req Header

Content-Type: multipart/form-data;
accessToken : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjgsIm5hbWUiOiLsp4DtmJwiLCJpYXQiOjE1OTcxMTEzNDMsImV4cCI6MTU5NzExNDk0MywiaXNzIjoiZHVrc3VuZyJ9.VE1M6XqCZyrXZry9GWrvmuiMHfSK6BM9iizEkJ3nzoc"

req Body

{
    "classId": 3,
    "questionId": 10,
    "img": "https://user-images.githubusercontent.com/61377122/99888934-e9d81800-2c93-11eb-840f-f4b08809b39a.png",
    "contents": "슬퍼요ㅠ_ㅠ"
}

res Body

게시글 작성 성공

{
    "status": 200,
    "success": true,
    "message": "게시글 생성 완료",
    "data": {
        "id": 1,
        "contents": "슬퍼요ㅠ_ㅠ",
        "updatedAt": "2020-11-21T22:37:06.434Z",
        "createdAt": "2020-11-21T22:37:06.434Z"
    }
}

게시글 작성 실패

{
    "status": 400,
    "success": false,
    "message": "게시글 작성 실패."
}

INTERNAL SERVER ERROR

{
    "status": 500,
    "message": "서버 내부 에러"
}
Clone this wiki locally