[BangPypers] Https and http difference in behaviour urllib2

Anand Balachandran Pillai abpillai at gmail.com
Tue Feb 28 10:47:53 CET 2012


On Wed, Feb 22, 2012 at 3:34 PM, Amit Sethi <amit.pureenergy at gmail.com>wrote:

> Hi all , Can someone explain to me why things are implemented the following
> in urllib2.
>
> When I pass encoded url using http it again encodes the parameters
> whereas in case of https it does not urlencode again
>
> so lets say the (http) call is
> http//:example.com?email=amit%40sethi.comthe request is
>
> http://example.com?email=amit%2540sethi.com
>
> where as in case of https it is
>
>  https://example.com?email=amit%40sethi.com
>

Been a while since I posted here!

For any kind of client side HTTP coding, I suggest the new requests library.
I myself have been a heavy user of urllib2/urllib but these libraries are
developer unfriendly and doesnt look like their problems are going to get
fixed soon.

Read this excellent blog post by Danny on comparing urllib2 vs requests.

http://pydanny.blogspot.in/2011/05/python-http-requests-for-humans.html




>
>
> Thanks
> Amit
>
>
>
> --
> A-M-I-T S|S
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 
--Anand


More information about the BangPypers mailing list