urlencode the keys and values