docs: def prepare_body(self, data, files):
          """Prepares the given HTTP body data."""
  
          # Check if file, fo, generator, iterator.
          # If not, run through normal process.
  
          # Nottin' on you.
          body = None
          content_type = None
          length = None
  
          is_stream = all([
              hasattr(data, '__iter__'),
              not isinstance(data, (basestring, list, tuple, dict))
          ])
  
          try:
              length = super_len(data)
          except (TypeError, AttributeError, UnsupportedOperation):
              length = None
  
          if is_stream:
              body = data
  
              if files:
                  raise NotImplementedError('Streamed bodies and files are mutually exclusive.')
  
              if length is not None:
                  self.headers['Content-Length'] = builtin_str(length)
              else:
                  self.headers['Transfer-Encoding'] = 'chunked'
          else:
              # Multi-part file uploads.
              if files:
                  (body, content_type) = self._encode_files(files, data)
              else:
                  if data:
                      body = self._encode_params(data)
                      if isinstance(data, basestring) or hasattr(data, 'read'):
                          content_type = None
                      else:
                          content_type = 'application/x-www-form-urlencoded'
  
              self.prepare_content_length(body)
  
              # Add content-type if it wasn't explicitly provided.
              if (content_type) and (not 'content-type' in self.headers):
                  self.headers['Content-Type'] = content_type
  
          self.body = body