code: def post_file(self, uri, body, files, **kwargs):
          
          # requests doesn't actually need us to open the files but we do anyway because
          # if we don't then the filename isn't preserved, so we assume each string
          # value is a filepath
          for key in files.keys():
              if isinstance(files[key], basestring):
                  files[key] = open(files[key], 'rb')
          kwargs["files"] = files
  
          # we ignore content type for posting files since it requires very specific things
          ct = self.headers.pop("content-type", None)
          ret = self.fetch('post', uri, {}, body, **kwargs)
          if ct:
              self.headers["content-type"] = ct
  
          # close all the files
          for fp in files.values():
              fp.close()
          return ret
docs: POST a file