Skip to content

Commit

Permalink
Ready 0.1.0a4
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreemt committed Aug 11, 2023
1 parent bf1db93 commit a6aa362
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
6 changes: 0 additions & 6 deletions curl-test.sh

This file was deleted.

26 changes: 26 additions & 0 deletions quick-test-server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
r"""
Test for curl/httpx/requseets.
# curl "http://127.0.0.1:8001/text/?q=test"
curl -X 'GET' 'http://127.0.0.1:8001/text/?q=test&to_lang=zh' -H 'accept: application/json'.
curl "http://127.0.0.1:8001/text/?to_lang=zh&q=test\nabc"
does not work
curl -X "POST" ^
"http://127.0.0.1:8001/text/" ^
-H "accept: application/json" ^
-H "Content-Type: application/json" ^
-d "{\"text\": \"test me\ntest him\", \"from_lang\": \"en\", \"to_lang\": \"zh\", \"description\": \"string\"}"
use:
python -c "import httpx; print(httpx.get('http://127.0.0.1:8001/text/?to_lang=de&q=test 1\ntest 2').json())"
run first:
python -m deepl_fastapi_pw
"""
import httpx

print(httpx.get('http://127.0.0.1:8001/text/?to_lang=de&q=test 1\ntest 2', timeout=20).json())

0 comments on commit a6aa362

Please sign in to comment.