url-encode any illegal characters in the path of the URL being parsed 

This pull request attempts to gracefully handle situations where a URL contains illegal characters in the path, for example:
"http://www.sears.com/search=slow cooker"
results in a path of
"/search=slow cooker"
Note that the equal sign is legal, but the space is not. This new code converts the path to
"/search=slow+cooker"

I encountered such an invalid URL at the end of a chain of redirects, which caused an exception to be thrown, preventing the GET request to the URL.