‣ (연로그)

카카오 API 문서 (my~ 관련)


Product

목록 조회

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" : "이미지입니다."
		}
}