ImgHub - 图片上传服务

API 接口

上传图片

POST /upload

支持多种上传方式:

1. Multipart/form-data 上传

curl -X POST -F "image=@example.jpg" https://imghub.did.fm/upload

2. 直接二进制数据上传

curl -X POST -H "Content-Type: image/jpeg" --data-binary @example.jpg https://imghub.did.fm/upload

3. JSON 格式 Base64 上传

curl -X POST -H "Content-Type: application/json" \
  -d '{"image": "data:image/jpeg;base64,/9j/4AAQ..."}' \
  https://imghub.did.fm/upload

4. 纯文本 Base64 上传

curl -X POST -H "Content-Type: text/plain" \
  -d "data:image/jpeg;base64,/9j/4AAQ..." \
  https://imghub.did.fm/upload

获取图片

GET /{filename}

curl https://imghub.did.fm/abc123.jpg

获取图片信息

GET /info?filename={filename}

curl "https://imghub.did.fm/info?filename=abc123.jpg"

健康检查

GET /health

curl https://imghub.did.fm/health

特性