Microservice archive file (attachment)

Requests

HTTP verb Endpoint Description

GET

/rest/v1/domain/mservices/<id>/attachment

File download

PUT

/rest/v1/domain/mservices/<id>/attachment

Uploading a new file

DELETE

/rest/v1/domain/mservices/<id>/attachment

Deleting a file

HEAD

/rest/v1/domain/mservices/<id>/attachment

Getting meta-information about a file


File download

Request

Table 1. Request parameters
Name Type Description

attachment

bool

Issuance Type. Default false.

true – is output with the header Content-Disposition: attachment; filename=filename.ext or Content-Disposition: attachment; filename*=UTF-8''%d1%84%d0%b0%d0%b9%d0%bb.ext, where file.ext is the file name in UTF-8 encoding and URLencoded.

false – untitled Content-Disposition.

Request example
GET /rest/v1/domain/mservices/68f99ca9-016c-d352-e02f-50e54938780c/attachment HTTP/1.1

Response

Response example
HTTP/1.1 200 OK
Content-Type: application/octet-stream; charset=utf-8
Content-Disposition: attachment; filename*=UTF-8''Mservice%201.zip

BINARY BODY OF 'Mservice 1.zip'

Uploading a new file

Performs a file replacement.

A single file is uploaded either with Content-Type: multipart/formdata, or with an arbitrary Content-Type that is not multipart.

If the download is done with Content-Type: multipart/formdata, then only the first file will be saved (the first part with the filename field in the header) Content-Disposition), and the file name itself will be ignored.

Request

Request example (octet-stream)
PUT /rest/v1/domain/mservices/68f99ca9-016c-d352-e02f-50e54938780c/attachment HTTP/1.1
Content-Type: application/octet-stream

BINARY BODY OF 'app.zip'
Request example (multipart)
PUT /rest/v1/domain/mservices/68f99ca9-016c-d352-e02f-50e54938780c/attachment HTTP/1.1
Content-Type: multipart/form-data; boundary=-----------boundary_69df8120352a996e

-----------boundary_69df8120352a996e
Content-Type: application/octet-stream
Content-Disposition: form-data; name="abcde"; filename="app.zip"
Content-Transfer-Encoding: binary

BINARY BODY OF 'app.zip'
-----------boundary_69df8120352a996e--

Response

Response example
HTTP/1.1 204 No Content

Deleting a file

Request

Request example
DELETE /rest/v1/domain/mservices/68f99ca9-016c-d352-e02f-50e54938780c/attachment HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content

Getting meta-information about a file

Returns meta-information about the file, including the size in the header Content-Length.

Features

  • HTTP-the response does not contain a body, despite the presence of a header Content-Length.

Request

Request example
HEAD /rest/v1/domain/mservices/4bfe3429-016d-0d12-cade-e0d55e0cd303/attachment?attachment=true HTTP/1.1

Response

Example of a successful response
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=roleapp_4bfe3429-016d-0d12-cade-e0d55e0cd303.zip
Content-Length: 25389
Example of an unsuccessful response
HTTP/1.1 404 Not Found