title: how to access POST data inside tastypie custom Authentication
body: <p>I'm trying to write custom Authentication in tastypie. Basically, I want to do the authentication using the post parameters and I don't want to use the django auth at all, so my code looks something like:</p>
  
  <pre><code>class MyAuthentication(Authentication):
     def is_authenticated(self, request, **kwargs):
         if request.method == 'POST':
             token = request.POST['token']
             key = request.POST['key']
             return is_key_valid(token,key)
  </code></pre>
  
  <p>This is more or less the idea. The problem is that I keep getting the following error:</p>
  
  <pre><code>"error_message": "You cannot access body after reading from request's data stream"
  </code></pre>
  
  <p>I understand that this is related to the fact that I'm accessing the POST, but I could not figure if there is a way to solve it. Any ideas? 
  Thanks.</p>
  
  <p><strong>EDIT:</strong> Maybe I forgot the mention the most important thing. I'm handling form data using a trick I found in github. My resource derives from multipart resource</p>
  
  <pre><code>class MultipartResource(object):
      def deserialize(self, request, data, format=None):
          if not format:
              format = request.META.get('CONTENT_TYPE', 'application/json')
  
          if format == 'application/x-www-form-urlencoded':
              return request.POST
  
          if format.startswith('multipart'):
              data = request.POST.copy()
              data.update(request.FILES)
              return data
          return super(MultipartResource, self).deserialize(request, data, format)
  </code></pre>