I need to send request. It looks like this cURL request:
curl --location --request POST 'http://127.0.0.1:8080/api/attachments'
--form 'data=@path/to/file/6C233C5F-B60D-41CA-86ED-A43C51FD7EED.png'
If to convert it to IDEA http request, it shall look like here:
POST http://127.0.0.1:8080/api/attachments
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="data"; filename="6C233C5F-B60D-41CA-86ED-A43C51FD7EED.png"
< path/to/file/6C233C5F-B60D-41CA-86ED-A43C51FD7EED.png
--WebAppBoundary--
Ok, but I need to send it with restTemplate. And it's desirable to use byte[] instead of file path.
Please, help.