REST sending files

Hi!
How can I send file(s) + json data in one request?
What should I put in rest-service.xml and how to handle it in ServiceBean?

Hi,
The rest-service.xml mechanism doesn’t support files as arguments:

REST API allows execution not only of methods that have arguments of simple datatypes, but also of methods with the following arguments:

  • entities
  • entities collections
  • serializable POJOs

https://doc.cuba-platform.com/restapi-7.2/#rest_api_v2_ex_service_post

So for your task you should write a normal Spring MVC controller, e.g. like adviced here:

To make this controller protected by the same authentication as other REST API methods, make configuration adjustments as described here: CUBA REST API