title: How to upload a folder using request.post in python?
body: <p>I am trying to upload a folder using post request in python....</p>
  
  <p>What i am trying to do?</p>
  
  <pre><code>@staticmethod
  def upload_folder(root_url, file_name, username, password):
      url = root_url + '/upload'
      token = get_token(root_url, username, password)
      headers = {'content-type': 'multipart/form-data',
             'accept': 'application/json',
             'Authorization': 'something' + token}
      files = {
            'file': ('folder.zip;type', open('C:/path/folder.zip', 'rb')),
            'filename': 'package1'
      }
      data = json.dumps{'file_name': file_name}
      result = requests.post(url, headers=headers, files=files, data=data)
      return result.content.decode()
  </code></pre>
  
  <p>I have to enter the below details in the swagger,</p>
  
  <p>file_name, folder in zip format...</p>
  
  <p>I somehow think that the files parameter is passed wrong or is there some other way to pass folders....Could someone help me with this? thanks...</p>