title: Python rest client for formData type
body: <p>I am writing a rest client in pytho with request api</p>
  
  <p>The rest server has rest api to upload file , it takes two parameters - </p>
  
  <p>file     - the actual file  and its type is formData</p>
  
  <p>fileName - the name of file in string and its type is also formData</p>
  
  <p>I am using the below code</p>
  
  <pre><code>file = f = open('C:/tmp/test.txt', 'rb')
  headers={'content-type':'multipart/form-data'}
  r = requests.post(url+'/rest/2.0/process?'+file=f&amp;fileName='test.txt'
  </code></pre>
  
  <p>but somehow its not working can anybody help where it needs correction</p>
  
  <p>the corresponding rest server method is </p>
  
  <pre><code>@POST
  @Consumes({"multipart/form-data"})
  @TypeHint(Test.class)
  public Response deployTestDefinition(@FormDataParam("file") InputStream file, 
  @FormDataParam("fileName") String fileName) {
  </code></pre>
  
  <p>my current request is like below :</p>
  
  <pre><code>    f = open('C:/tmp/Test.txt', 'rb')
      files = {'file' : ('Test.txt', f), 'fileName':'Test.txt'}
      headers={'content-type':'multipart/form-data'}
      r = requests.post(url+'/rest/2.0/process',files=files,headers=headers,cookies=token,verify=False)
  </code></pre>
  
  <p>but still not working status 400</p>
  
  <p>Thanks</p>