title: How do I add a file to a POST request made in Locust.io?
body: <p>I'm using Locust.io to load test a python/django website that accepts image upload::</p>
  
  <pre><code>headers = {'content-type': 'multipart/form-data'}
  image = open('img.jpg', 'rb')
  payload = {'id': self.id}
  files = {'photo': image}    
  upload_result = self.client.post("/image/", data=payload, files=files, headers=headers)
  </code></pre>
  
  <p>When I use the above I see <code>request.FILES</code> in Django is <code>None</code>. However when I use POSTMAN instead of Locust to do the same thing, I get the files object in <code>request</code> in Django.</p>
  
  <p>server.py</p>
  
  <pre><code>photo = request.FILES.get('photo')
  id = request.POST.get('id')
  form = PhotosModelForm(request.POST, request.FILES)
  </code></pre>
  
  <p>How do I send the file in the Locust HTTP client request along with some POST data?</p>