Sending requests with files in the CRUD service

When requesting to CRUD using POST, PATCH and PUT methods, you can transfer files in the request body.

Files are sent and received in two ways:

  • the data is sent in the json format, then the file content is transferred as a string in the Base64 format in the corresponding field of the metadata class.
  • data is sent as FormData (application/x-www-form-urlencoded), then files are transmitted as multipart.

Correct reception of file attributes in case of sending such requests is carried out using the POST , PUT and PATCH methods in the CRUD service.

It is also possible to transfer references and collections according to the example described for the soap module.

The examples of the POST requests with files to CRUD in dnt: test/modules/rest/crud.spec.js

/checking crud service/# sending a file with multipart body request (POST)
/checking crud service/# sending a file with json body request (POST)