Files
qiming/qiming-mcp-proxy/document-parser/test_delete_api.rest
2026-06-01 13:03:20 +08:00

35 lines
1.1 KiB
ReStructuredText
Raw Permalink 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.
### 测试删除OSS文件API
### 变量定义
@baseUrl = http://localhost:8080
@apiPrefix = /api/v1/oss
### 1. 先上传一个测试文件
POST {{baseUrl}}{{apiPrefix}}/upload
Content-Type: multipart/form-data; boundary=boundary
--boundary
Content-Disposition: form-data; name="file"; filename="test_file.txt"
Content-Type: text/plain
这是一个测试文件内容,用于测试删除功能。
--boundary--
### 2. 生成上传签名URL
GET {{baseUrl}}{{apiPrefix}}/upload-sign-url?file_name=test_delete_file.txt&content_type=text/plain
### 3. 删除文件使用在第1步上传的文件名
DELETE {{baseUrl}}{{apiPrefix}}/delete?file_name=uploads/20240101_123456_test_file.txt
### 4. 删除文件使用edu前缀
DELETE {{baseUrl}}{{apiPrefix}}/delete?file_name=edu/test_delete_file.txt
### 5. 删除不存在的文件应该返回404
DELETE {{baseUrl}}{{apiPrefix}}/delete?file_name=not_exist_file.txt
### 6. 删除文件名为空应该返回400
DELETE {{baseUrl}}{{apiPrefix}}/delete?file_name=
### 7. 不提供文件名参数应该返回400
DELETE {{baseUrl}}{{apiPrefix}}/delete