Код: Выделить всё
@app.post('/upload')
async def accept_some_file(f: UploadFile):
content = await f.read()
# ... do stuff with content and generate a response
Я бы хотел иметь возможность отправлять байты файла напрямую через запрос, который выглядит следующим образом:
Код: Выделить всё
POST /upload HTTP/1.1
Host: localhost:8080
User-Agent: curl/7.79.1
Accept: */*
Content-Type: image/jpeg
Content-Length: 11044
... image bytes
Подробнее здесь: https://stackoverflow.com/questions/720 ... ta-request
Мобильная версия