[Sample code](https://github.com/GoogleCloudPlatform/gsutil/blob/master/gslib/third_party/storage_apitools/credentials_lib.py#L135) where we use `urllib2` in `gsutil`, for exactly this purpose.