Adding URI.encode to parse_url method so URLs get encoded correctly

This is an issue with the current version of rest-client. Incase a user passes in a url with spaces in it, then rest client will raise a Bad URI error.
My proposed fix is to encode all URIs before attempting to parse them.