Closed erickpeirson closed 5 years ago
We require a module at classifier/routes.py that defines two HTTP routes:
classifier/routes.py
POST
/classify
GET
/status
Note that the routes are responsible for:
Note that (per #2) the classify controller requires an IO[bytes] containing the raw body of the request. If the content-type is not set, this may be request.stream. Otherwise, just use an io.BytesIO wrapping request.data. See https://github.com/arXiv/arxiv-submission-preview/blob/4c4e28261bc2ebaf5ce223b4a4ea7249fec5ae8f/preview/routes.py#L67-L80 for an example.
IO[bytes]
request.stream
io.BytesIO
request.data
We require a module at
classifier/routes.py
that defines two HTTP routes:POST
to/classify
GET
to/status
Note that the routes are responsible for:
Note that (per #2) the classify controller requires an
IO[bytes]
containing the raw body of the request. If the content-type is not set, this may berequest.stream
. Otherwise, just use anio.BytesIO
wrappingrequest.data
. See https://github.com/arXiv/arxiv-submission-preview/blob/4c4e28261bc2ebaf5ce223b4a4ea7249fec5ae8f/preview/routes.py#L67-L80 for an example.