Am 24.08.2017 um 00:07 schrieb holo:

I find out how to force it to work in issue and with help on IRC channel, but it is looking like some "hack" not "proper" solution. Should we handle POSTs requests in REST API such way? If not what is proper way to post just JSON file to api? Only with parameters?

Sending files is currently not yet directly supported by the REST
interface generator, so that accessing the response object directly
using the mentioned "hack" with @before is currently the only way to
make this work in an efficient way.

It's something that is planned to be supported in some way, though.
Maybe using an annotation or using a special return type:

 @sendFile
 NativePath getSomeJsonFile(string name)
 {
     return NativePath("files/"~name~".json);
 }

(Note: this could actually be implemented on top of the current API by
defining @sendFile as an alias to @after)

Another possibility would be to support returning an InputStream that
contains arbitrary contents to be sent as the body.