Files
ocr-server/http/ocr-server.http
T
zimoyin 11883e260f init
2026-10-11 02:26:26 +08:00

38 lines
810 B
HTTP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@host = http://127.0.0.1:8000
### 健康检查
GET {{host}}/healthz
### 上传图片
# @name uploadImage
POST {{host}}/api/v1/upload
Content-Type: multipart/form-data; boundary=ocrBoundary
--ocrBoundary
Content-Disposition: form-data; name="file"; filename="general_ocr_002.png"
Content-Type: image/jpeg
< ./fixtures/general_ocr_002.png
--ocrBoundary--
> {% client.global.set("fileId", response.body.data.file_id); %}
### 使用上传返回的 file_id 识别文字
# 先执行上面的上传请求,IDEA 会自动保存返回的 file_id。
POST {{host}}/api/v1/i2t
Content-Type: application/json
{
"file_id": "{{fileId}}",
"min_confidence": 0.0
}
### 识别并过滤低置信度文本
POST {{host}}/api/v1/i2t
Content-Type: application/json
{
"file_id": "{{fileId}}",
"min_confidence": 0.8
}