def update_query_params(uri, params):
 parts = urllib.parse.urlparse(uri)
 query_params = parse_unique_urlencoded(parts.query)
 query_params.update(params)
 new_query = urllib.parse.urlencode(query_params)
 new_parts = parts._replace(query=new_query)
 return urllib.parse.urlunparse(new_parts)

def update_query_params ( uri , params ) : parts = urllib . parse . urlparse ( uri ) query_params = parse_unique_urlencoded ( parts . query ) query_params . update ( params ) new_query = urllib . parse . urlencode ( query_params ) new_parts = parts . _replace ( query = new_query ) return urllib . parse . urlunparse ( new_parts )
updates a uri with new query parameters .