Porovnat verze

Klíč

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

FunkceTo download a file.

Request

  • Urn:              /api/

...

  • download
  • Method:      POST
  • Request header:  Cookie: session  - actual session value.
  • Request content: json
POST /api/upload HTTP/1.1
Blok kódu
titlepožadavek
Json schema:
{
      Content-Type"$schema": multipart/form-data; boundary=----BoundaryIdentificatorkTrZ"http://json-schema.org/draft-07/schema#",
    Content-Length: 205
  "title": "passwd - request",
      Cookie"type": session=f3a78dd4e51e7
"object",
      ------BoundaryIdentificatorkTrZu0gW"properties": {
    Content-Disposition: form-data; name="json"

    "name": {
          {"nametype": "firmware"string"
        }
     ------BoundaryIdentificatorkTrZu0gW },
    Content-Disposition: form-data; name="filerequired" filename="fw.bin"
: [
        "name"
     Content-Type: application/octet-stream

 ],
      (… binary file data …)
    ------BoundaryIdentificatorkTrZ--

...

"additionalProperties": false
}

Meaning of json items:

  • $.name:
    File type content definition; defined by parameter name.
    Type: string.
    Mandatory.
Blok kódu
titleExample
{
      "name": "fw_file“
}

Response

  • Response code:
    • 200 – OK
    • 400 – Error (bad request)
    • 401 – Unauthorized
    • 500 – Server error
    • 512 - Internal application error
  • Response header: Set-Cookie: session  -

...

  • Actual session value.

...

  • Response type: Data type is depending on the content of the downloaded file. (application/octet-stream, application/json,…)
  • Response content: Occurs only for response code = 200.