Work in progress #6: Define header sets
[tolino-api-docs.git] / api / pageplace.bosh-bosh-rest-upload.rst
1 ===================================================
2 ``POST https://bosh.pageplace.de/bosh/rest/upload``
3 ===================================================
4 Upload a new book ``.epub`` file.
5
6 Step 1 of the `upload process`_.
7
8
9 Request
10 =======
11 Header
12   Nearly identical to the `bosh v1 header set`_, but not exactly the same.
13   No ``client_type``, no ``client_version``.
14
15   ``Content-Type``
16     ``multipart/form-data; boundary="Boundary1612163626238"``
17   ``Content-Transfer-Encoding``
18     ``binary``
19   ``Content-Length``
20     Depending on the request body.
21
22 Request body
23   Control data
24     Header
25       ``Content-Disposition: form-data; name="control"``
26     Content
27       JSON
28       ``{"filesize":334499,"transactionId":"84401550-d933-4f12-b168-87421835bada"}``
29   File data
30     Header
31       ``Content-Disposition: form-data; name="file"; filename="MacBest by Pratchett Terry.epub"``
32     Content
33       Binary .epub file contents
34
35
36 Response
37 ========
38 HTTP status code: ``200 OK``.
39
40 Meta data entry for the uploaded file.
41
42 Example:
43
44 .. include:: pageplace.bosh-bosh-rest-upload.response.json
45    :code: