def upload_file(self, file):
url = self._get_url('<STR_LIT>')<EOL>fcontent = FileContent(file)<EOL>binary_data = fcontent.get_binary()<EOL>headers = self._get_request_headers()<EOL>req = urllib.request.Request(url, binary_data, headers)<EOL>req.add_header('<STR_LIT>', fcontent.get_content_type())<EOL>req.add_header('<STR_LIT>', len(binary_data))<EOL>resp = urllib.request.urlopen(req)   <EOL>return definition.UploadPostResponse(_response_to_json(resp))<EOL>
The method is posting file to the remote server