글 단건조회

요청

GET /posts/1 HTTP/1.1
Accept: application/json
Host: api.simpleblog.com
Table 1. /posts/{postId}
Parameter Description

postId

게시글 ID

응답

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 72

{"id":1,"title":"글 제목입니다.","content":"글 내용입니다."}
Path Type Description

id

Number

게시글 ID

title

String

제목

content

String

내용

curl

$ curl 'https://api.simpleblog.com/posts/1' -i -X GET \
    -H 'Accept: application/json'

글 작성

요청

POST /posts/ HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Content-Length: 65
Host: api.simpleblog.com

{"title":"글 제목입니다.","content":"글 내용입니다."}
Path Type Description Optional Constraint

title

String

제목

좋은 제목 입력해주세요.

content

String

내용

Y

응답

HTTP/1.1 200 OK

curl

$ curl 'https://api.simpleblog.com/posts/' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -H 'Accept: application/json' \
    -d '{"title":"글 제목입니다.","content":"글 내용입니다."}'