-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_main.http
More file actions
54 lines (40 loc) · 1.4 KB
/
Copy pathtest_main.http
File metadata and controls
54 lines (40 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Test your FastAPI endpoints
GET http://127.0.0.1:8000/
Accept: application/json
###
# Readiness: checks the database and object store.
GET http://127.0.0.1:8000/readyz
Accept: application/json
###
# Convert a document synchronously.
#
# Workers still convert chunks in parallel, but this request waits for all of
# them and returns the original {id, content, pagination} response.
POST http://127.0.0.1:8000/convert
Content-Type: application/json
x-api-key: NxQUCbbezCZ8KUhMtg5s0MQTQU4gDQ7
{
"file": "https://example.com/some-long-document.pdf"
}
###
# Submit a document asynchronously. Returns 202 with a `job_id` and `doc_key`;
# if this exact file was converted before, returns the first page immediately.
POST http://127.0.0.1:8000/async/convert
Content-Type: application/json
x-api-key: NxQUCbbezCZ8KUhMtg5s0MQTQU4gDQ7
{
"file": "https://example.com/some-long-document.pdf"
}
###
# Poll a job. `status` goes queued -> running -> done (or failed), and
# `progress` reports how many chunks have finished.
GET http://127.0.0.1:8000/convert/jobs/REPLACE_WITH_JOB_ID
Accept: application/json
x-api-key: NxQUCbbezCZ8KUhMtg5s0MQTQU4gDQ7
###
# Fetch a page once the job is done. Use the `doc_key` from the submission
# response and `pagination.next_page` to walk the document.
GET http://127.0.0.1:8000/convert/REPLACE_WITH_DOC_KEY/pages/1
Accept: application/json
x-api-key: NxQUCbbezCZ8KUhMtg5s0MQTQU4gDQ7
###