‣ (연로그)
HTTP request
GET /api/products HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 35
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 47
{
[
"id" : 1
"name" : "맥북"
"price" : 1000
"stockQuantity" : 10
"thumbnailImage" : {
"url" : "url",
"alt" : "이미지입니다."
}
],
[
"id" : 2
"name" : "애플 워치"
"price" : 100
"stockQuantity" : 10
"thumbnailImage" : {
"url" : "url",
"alt" : "이미지입니다."
}
]
}
→ 관리자 기능이 없어서 상품 추가 기능도 없음
HTTP request
POST /api/products HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 35
Host: localhost:8080
{
"name" : "맥북"
"price" : 1000
"stockQuantity" : 10
"thumbnailImage" : {
"url" : "url",
"alt" : "이미지입니다."
}
}
HTTP response
HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Location: /api/products/1
Content-Type: application/json
Content-Length: 47
{
"id" : 1
"name" : "맥북"
"price" : 1000
"stockQuantity" : 10
"thumbnailImage" : {
"url" : "url",
"alt" : "이미지입니다."
}
}
HTTP request
GET /api/products/{productId} HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 35
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 47
{
"id" : 1
"name" : "맥북"
"price" : 1000
"stockQuantity" : 10
"thumbnailImage" : {
"url" : "url",
"alt" : "이미지입니다."
}
}