Funkce /api/donwload slouží ke stažení souboru (JAKÉHO?). Formát odpovědi závisí na typu stahovaného obsahu application/octet-stream, application/json apod.
požadavek
POST /api/upload HTTP/1.1 Content-Type: multipart/form-data; boundary=----BoundaryIdentificatorkTrZ Content-Length: 205 Cookie: session=f3a78dd4e51e7 ------BoundaryIdentificatorkTrZu0gW Content-Disposition: form-data; name="json" {"name":"firmware"} ------BoundaryIdentificatorkTrZu0gW Content-Disposition: form-data; name="file" filename="fw.bin" Content-Type: application/octet-stream (… binary file data …) ------BoundaryIdentificatorkTrZ--
Urn: /api/upload
Metoda: POST
Request header: Cookie: session - actual session value.
Request type: multipart/form-data
Multipart items:
- It‘s necessary to keep the order of these items.
item: name="json":
A string item with the json structure.
Json schema for multipart item "json":{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "upload - request", "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": false }
- item: name="file":
Binary/text file data to send.