def make_request(method, url, params=None, data=None, headers=None, auth=None):
http = httplib2.Http(<EOL>ca_certs=get_cert_file(),<EOL>)<EOL>if auth is not None:<EOL><INDENT>http.add_credentials(auth[<NUM_LIT:0>], auth[<NUM_LIT:1>])<EOL><DEDENT>if params is not None:<EOL><INDENT>enc_params = urlencode(params, doseq=True)<EOL>if urlparse(url).query:<EOL><INDENT>url = '<STR_LIT>' % (url, enc_params)<EOL><DEDENT>else:<EOL><INDENT>url = '<STR_LIT>' % (url, enc_params)<EOL><DEDENT>params["<STR_LIT>"] = "<STR_LIT>"<EOL><DEDENT>def encode_atom(atom):<EOL><INDENT>if isinstance(atom, (integer_types, binary_type)):<EOL><INDENT>return atom<EOL><DEDENT>elif isinstance(atom, string_types):<EOL><INDENT>return atom.encode('<STR_LIT:utf-8>')<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>if data is not None:<EOL><INDENT>udata = {}<EOL>for k, v in iteritems(data):<EOL><INDENT>key = k.encode('<STR_LIT:utf-8>')<EOL>if isinstance(v, (list, tuple, set)):<EOL><INDENT>udata[key] = [encode_atom(x) for x in v]<EOL><DEDENT>elif isinstance(v, (integer_types, binary_type, string_types)):<EOL><INDENT>udata[key] = encode_atom(v)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>data = udata<EOL>data = urlencode(udata, doseq=True)<EOL><DEDENT>response, content = http.request(uri=url, method=method,<EOL>headers=headers, body=data)<EOL>return Response(response, content, url)<EOL>
Make an HTTP request.

:param str   method:  "POST", "GET", "PUT" or "DELETE"
:param str   url:     URL to process request.
:param dict  params:  Params to add to the URL.
:param dict  data:    Form data.
:param dict  headers: Headers to request.
:param tuple auth:    Username and token.