title: API POST call which uploads an excel sheet
body: <p>I'm trying to make a POST call from a ruby script which upload through my authserver api an excel with roles from the same directory. I try to reproduce the call from postman without luck, and it looks something like this:</p>
  
  <pre><code>uri = URI.parse("http://authserver:8080/svc/batchImport/v2/direct/roles")
  request = Net::HTTP::Post.new(uri)
  request["Content-Type"] = 'application/xlsx'
  request["externalTenantId"] = tntid
  request["uid"] = uid
  request.body ={
        "file"=&gt; "Roles.xlsx",
        "importMode"=&gt; "OVERWRITE",
        "tenantId"=&gt; tntid,
      }.to_json
  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
    http.request(request)
  end
  puts response.code
  puts response.body
  </code></pre>
  
  <p>So basically tntid and uid will be the header for the call and the body will be a form-data.Please find below error I get:</p>
  
  <pre><code>500
  {"errorCode":["com.domain.common.exception.DefaultErrorCode","UNEXPECTED_ERROR"],"errorMessage":"Unknown server error occurred.","developerMessage":null,"moreInfo":null}
  </code></pre>