21 lines
450 B
Python
21 lines
450 B
Python
import requests
|
|
import json
|
|
import os
|
|
|
|
url = "http://localhost:3015/documents/upload"
|
|
headers = {
|
|
"X-API-Key": "jleu1212",
|
|
"accept": "application/json",
|
|
}
|
|
files = {
|
|
"file": open("test/ocr.pdf", "rb"),
|
|
}
|
|
data = {
|
|
"workspace": "test1",
|
|
"chunk_size": 1200,
|
|
"chunk_overlap": 100,
|
|
}
|
|
|
|
response = requests.post(url, headers=headers, files=files, data=data)
|
|
print(f"Status: {response.status_code}")
|
|
print(f"Response: {response.text}") |