def prepare_request(uri, headers=None, data=None, method=None):
 if (headers is None):
  headers = {}
 if (data and (not method)):
  method = 'POST'
 elif (not method):
  method = 'GET'
 if ((method == 'GET') and data):
  uri = add_params_to_uri(uri, data)
  data = None
 return (uri, headers, data, method)

def prepare_request ( uri , headers = None , data = None , method = None ) : if ( headers is None ) : headers = { } if ( data and ( not method ) ) : method = 'POST' elif ( not method ) : method = 'GET' if ( ( method == 'GET' ) and data ) : uri = add_params_to_uri ( uri , data ) data = None return ( uri , headers , data , method )
make request parameters right .