title: Sending a csv file via curl POST to Django REST Framework endpoint
body: <p>I have a csv file that I want to send via curl to a Django Rest Framework API View I have developed. The csv file itself contains only <code>foo,bar</code> and this is the curl command I'm using:</p>
  
  <pre><code>curl URL -H 'Accept: 
  application/json' -H 'Referer: http://localhost:5011/ost:5011' -H 
  'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) 
  AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 
  Safari/537.36' -H 'Authorization: JWT TOKEN  -H 'Content-Type: 
  multipart/form-data' -F upload=@testcsv.csv
  </code></pre>
  
  <p>When it hits my API View in Django, and I run</p>
  
  <pre><code>request.data.get('file').read()
  </code></pre>
  
  <p>the output is some metadata around the file and not the file contents itself:</p>
  
  <pre><code>(Pdb) b'--------------------------001ec735bfc1a929\r\nContent-
  Disposition: form-data; name="upload"; 
  filename="testcsv.csv"\r\nContent-Type: application/octet-
  stream\r\n\r\n\r\n--------------------------001ec735bfc1a929--\r\n'
  </code></pre>
  
  <p>How can I access the actual file itself through this method? My APIview is using </p>
  
  <pre><code>class FileUploadView(APIView):
       parser_classes = (MultiPartParser,)
  </code></pre>
  
  <p>Thanks!</p>