'http -> https
https -> http
:return: A copy of the current object, with the protocol switched'

def switch_protocol(self):

    proto = self.get_protocol()
    changed_proto_url = self.copy()
    if (proto == 'https'):
        changed_proto_url.set_protocol('http')
    else:
        changed_proto_url.set_protocol('https')
    return changed_proto_url
