Porovnat verze

Klíč

  • Tento řádek byl přidán.
  • Tento řádek byl odstraněn.
  • Formátování bylo změněno.

...

Blok kódu
titlepož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--

 UrnUrn: /api/upload
  Method:           Metoda: POST
  Request header:   Cookie: session  - actual session value.
  Request type: multipart/form-data

Multipart items:

Poznámka
  • It‘s necessary to keep the order of these items.
  1. item: name="json":
                A string item with the json structure.
                Json schema for multipart

...

  1. item "json":

    Blok kódu
    {
    	"$schema": "http://json-schema.org/draft-07/schema#",
        "title": "upload - request",
        "type": "object",
        "properties": {
        	"name": {
        		"type": "string"
    		}
        },
    	"required": [
        	"name"
    	],
        "additionalProperties": false
        }


  2. item: name="file":
                Binary/text file data to send.