API 목록

이미지 업로드 API (회원용)

Curl request

$ curl 'http://localhost:8080/api/images/thumbnail' -i -X POST \
    -H 'Content-Type: multipart/form-data' \
    -H 'X-USER-ID: 1' \
    -F 'image=@test.png;type=image/png'

HTTP request

POST /api/images/thumbnail HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
X-USER-ID: 1
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=image; filename=test.png
Content-Type: image/png

<<png data>>
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--

HTTP response

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

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : "https://localhost:8080/images/thumbnail/test.png"
}

Path parameters

Table 1. /api/images/{type}
Parameter Description

type

업로드 할 이미지 유형. ex) THUMBNAIL, ARTICLE, COMMENT

Request headers

Name Description

x-user-id

로그인한 유저 id

Request parts

Part Description

image

업로드할 이미지

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

String

업로드 된 이미지 URL


이미지 업로드 API (내부용)

Curl request

$ curl 'http://localhost:8080/api/internal/images/thumbnail' -i -X POST \
    -H 'Content-Type: multipart/form-data' \
    -F 'image=@test.png;type=image/png'

HTTP request

POST /api/internal/images/thumbnail HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=image; filename=test.png
Content-Type: image/png

<<png data>>
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--

HTTP response

HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
Content-Length: 48

https://localhost:8080/images/thumbnail/test.png

Path parameters

Table 1. /api/internal/images/{type}
Parameter Description

type

업로드 할 이미지 유형. ex) THUMBNAIL, ARTICLE, COMMENT

Request parts

Part Description

image

업로드할 이미지


이미지 조회 API

Curl request

$ curl 'http://localhost:8080/images/thumbnail/test.png' -i -X GET

HTTP request

GET /images/thumbnail/test.png HTTP/1.1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Cache-Control: max-age=31536000
Content-Type: image/png
Content-Length: 12

<<png data>>

Path parameters

Table 1. /images/{type}/{fileName}
Parameter Description

type

조회할 할 이미지 유형. ex) THUMBNAIL, ARTICLE, COMMENT

fileName

이미지 이름. ex) THUMBNAIL, ARTICLE, COMMENT


이미지 조회 API (존재하지 않는 이미지)

Curl request

$ curl 'http://localhost:8080/images/thumbnail/notfound-image.png' -i -X GET

HTTP request

GET /images/thumbnail/notfound-image.png HTTP/1.1
Host: localhost:8080

HTTP response

HTTP/1.1 404 Not Found

Path parameters

Table 1. /images/{type}/{fileName}
Parameter Description

type

조회할 할 이미지 유형. ex) THUMBNAIL, ARTICLE, COMMENT

fileName

이미지 이름. ex) THUMBNAIL, ARTICLE, COMMENT