@staticmethod<EOL><INDENT>def _post(url, data, content_type, params=None):<DEDENT>
try:<EOL><INDENT>response = requests.post(url, params=params, data=data, headers={<EOL>'<STR_LIT:Content-Type>': content_type,<EOL>})<EOL>response.raise_for_status()<EOL>return response.json()<EOL><DEDENT>except NameError:<EOL><INDENT>url = '<STR_LIT>'.format(url, urllib.urlencode(params))<EOL>req = urllib2.Request(url, data.encode(ENCODING), {<EOL>'<STR_LIT:Content-Type>': content_type,<EOL>})<EOL>return json.loads(urllib2.urlopen(req).read().decode(ENCODING))<EOL><DEDENT>
HTTP POST request.