게시글 단건 조회
Request
CURL
$ curl 'https://localhost:8443/api/boards/1' -i -X GET \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: */*'
HTTPie
$ http GET 'https://localhost:8443/api/boards/1' \
'Content-Type:application/json;charset=UTF-8' \
'Accept:*/*'
Request HTTP Example
GET /api/boards/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: */*
Host: localhost:8443
Response
Response Fields
필드 | 타입 | 필수값 | 설명 | 제한 |
---|---|---|---|---|
id |
Number |
true |
게시글 고유 번호 |
|
memberResponse |
Object |
true |
작성자 |
|
title |
String |
true |
제목 |
|
content |
String |
true |
내용 |
|
hit |
Number |
true |
조회수 |
|
boardCategory |
String |
true |
게시글 분류 |
|
_links |
Object |
true |
HATEOAS |
Response HTTP Example
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: SAMEORIGIN
Content-Length: 768
{
"id" : 1,
"memberResponse" : {
"id" : 5,
"email" : "panda@naver.com",
"nickname" : "panda",
"profileImage" : null,
"phone" : null,
"license" : null,
"createdDateTime" : "2021-10-25T01:13:36.586102",
"lastModifiedDateTime" : "2021-10-25T01:13:36.586102",
"leaveDateTime" : null,
"authority" : null,
"address" : null,
"authProvider" : null,
"status" : "ACTIVE"
},
"title" : "panda",
"content" : "bear",
"hit" : 1,
"boardCategory" : "NOTICE",
"_links" : {
"self" : {
"href" : "https://localhost:8443/api/boards/1"
},
"modify-board" : {
"href" : "https://localhost:8443/api/boards/1"
},
"delete-board" : {
"href" : "https://localhost:8443/api/boards/1"
}
}
}
게시글 다건 조회
Request
CURL
$ curl 'https://localhost:8443/api/boards' -i -X GET \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: */*'
HTTPie
$ http GET 'https://localhost:8443/api/boards' \
'Content-Type:application/json;charset=UTF-8' \
'Accept:*/*'
Request HTTP Example
GET /api/boards HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: */*
Host: localhost:8443
Response
Response Fields
필드 | 타입 | 필수값 | 설명 | 제한 |
---|---|---|---|---|
_embedded.boardResponseList |
Array |
true |
게시글 리스트 |
|
_links |
Object |
true |
HATEOAS |
|
page |
Object |
true |
페이지 설정 |
Response HTTP Example
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: SAMEORIGIN
Content-Length: 854
{
"_embedded" : {
"boardResponseList" : [ {
"id" : 1,
"memberResponse" : {
"id" : 9,
"email" : "panda@naver.com",
"nickname" : "panda",
"profileImage" : null,
"phone" : null,
"license" : null,
"createdDateTime" : "2021-10-25T01:13:37.997277",
"lastModifiedDateTime" : "2021-10-25T01:13:37.997277",
"leaveDateTime" : null,
"authority" : null,
"address" : null,
"authProvider" : null,
"status" : "ACTIVE"
},
"title" : "panda",
"content" : "bear",
"hit" : 0,
"boardCategory" : "NOTICE"
} ]
},
"_links" : {
"self" : {
"href" : "https://localhost:8443/api/boards?page=0&size=10"
}
},
"page" : {
"size" : 10,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
}
}
게시글 추가
Request
CURL
$ curl 'https://localhost:8443/api/boards' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: */*' \
-d '{
"email" : "panda@naver.com",
"title" : "polar",
"content" : "bear",
"boardCategory" : "FREE"
}'
HTTPie
$ echo '{
"email" : "panda@naver.com",
"title" : "polar",
"content" : "bear",
"boardCategory" : "FREE"
}' | http POST 'https://localhost:8443/api/boards' \
'Content-Type:application/json;charset=UTF-8' \
'Accept:*/*'
Request Fields
필드 | 타입 | 필수값 | 설명 | 제한 |
---|---|---|---|---|
String |
true |
이메일 |
이메일 형식 9-64자 |
|
title |
String |
true |
제목 |
최대 255자 |
content |
String |
true |
내용 |
최대 65535자 |
boardCategory |
String |
true |
게시글 분류 |
FREE, QNA, NOTICE 중 하나 |
Request HTTP Example
POST /api/boards HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: */*
Content-Length: 104
Host: localhost:8443
{
"email" : "panda@naver.com",
"title" : "polar",
"content" : "bear",
"boardCategory" : "FREE"
}
Response
Response HTTP Example
HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: SAMEORIGIN
게시글 수정
Request
CURL
$ curl 'https://localhost:8443/api/boards' -i -X PATCH \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: */*' \
-d '{
"title" : "bear",
"content" : "panda",
"boardCategory" : null
}'
HTTPie
$ echo '{
"title" : "bear",
"content" : "panda",
"boardCategory" : null
}' | http PATCH 'https://localhost:8443/api/boards' \
'Content-Type:application/json;charset=UTF-8' \
'Accept:*/*'
Request Fields
필드 | 타입 | 필수값 | 설명 | 제한 |
---|---|---|---|---|
title |
String |
제목 |
최대 255자 |
|
content |
String |
내용 |
최대 65535자 |
|
boardCategory |
String |
게시글 분류 |
FREE, QNA, NOTICE 중 하나 |
Request HTTP Example
PATCH /api/boards HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: */*
Content-Length: 71
Host: localhost:8443
{
"title" : "bear",
"content" : "panda",
"boardCategory" : null
}
Response
Response HTTP Example
HTTP/1.1 405 Method Not Allowed
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Allow: GET, POST
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: SAMEORIGIN
게시글 단건 삭제
Request
CURL
$ curl 'https://localhost:8443/api/boards/1' -i -X DELETE \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: */*'
HTTPie
$ http DELETE 'https://localhost:8443/api/boards/1' \
'Content-Type:application/json;charset=UTF-8' \
'Accept:*/*'
Request HTTP Example
DELETE /api/boards/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: */*
Host: localhost:8443
Response
Response HTTP Example
HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: SAMEORIGIN
관리자 전용 게시글 다건 조회
Request
CURL
$ curl 'https://localhost:8443/api/boards/admin' -i -X GET \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: */*'
HTTPie
$ http GET 'https://localhost:8443/api/boards/admin' \
'Content-Type:application/json;charset=UTF-8' \
'Accept:*/*'
Request HTTP Example
GET /api/boards/admin HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: */*
Host: localhost:8443
Response
Response Fields
필드 | 타입 | 필수값 | 설명 | 제한 |
---|---|---|---|---|
_embedded.boardResponseList |
Array |
true |
게시글 리스트 |
|
_links |
Object |
true |
HATEOAS |
|
page |
Object |
true |
페이지 설정 |
Response HTTP Example
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: SAMEORIGIN
Content-Length: 861
{
"_embedded" : {
"boardResponseList" : [ {
"id" : 1,
"memberResponse" : {
"id" : 11,
"email" : "panda@naver.com",
"nickname" : "panda",
"profileImage" : null,
"phone" : null,
"license" : null,
"createdDateTime" : "2021-10-25T01:13:38.205996",
"lastModifiedDateTime" : "2021-10-25T01:13:38.205996",
"leaveDateTime" : null,
"authority" : null,
"address" : null,
"authProvider" : null,
"status" : "ACTIVE"
},
"title" : "panda",
"content" : "bear",
"hit" : 0,
"boardCategory" : "NOTICE"
} ]
},
"_links" : {
"self" : {
"href" : "https://localhost:8443/api/boards/admin?page=0&size=10"
}
},
"page" : {
"size" : 10,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
}
}