Using the RestClient stone, we can easily handle file downloads, but make sure you install the rest-client stone.
And I also added a screenshot from an example request from a postman.
And the code in the controller, as shown below,
res = RestClient::Request.execute(
method: :post,
url: "http://www.your_url.com",
payload: params,
headers: {
'Content-Type' => "multipart/form-data",
Authorization: "some_key",
:Accept => "*/*"
}
)
enter image description here
source
share