Requests for `/v2.0/conversion` will result in 415

The following request is made to /v2.0/conversion.

We are using Faraday on the Rails API server.

file = Faraday::Multipart::FilePart.new(file_path, file_name)
      connection = Faraday.new(url: "https://api.groupdocs.cloud") do |builder|
        builder.request :multipart
      end
res = connection.post("/v2.0/conversion") do |req|
        req.headers["Authorization"] = "Bearer #{access_token}"
        req.body = {
          "format": "pdf",.
          "File": file, }
        }
      end

Why do I get 415 for the above request?

@VideoStep

It seems you are trying to convert a document from the request body. Please check the following sample cURL command. Hopefully, it will help you understand how the GroupDocs.Conversion Cloud API works via a REST API client.

curl -X PUT "https://api.groupdocs.cloud/v2.0/conversion?format=pdf&fromPage=1&pagesCount=0" 
-H "accept: application/json" 
-H "authorization: Bearer eyJhbGciOiJSU....tRrwamShmZTmoSQ" 
-H "Content-Type: multipart/form-data" 
-F File="@C:/Temp/02_pages.docx" 
--output C:/Temp/testconv.pdf
1 Like