secure and urlencode the params to not destroy the url 

secure and urlencode the params to not destroy the url
and add missing line endings