Move the creation of the Agent into the request

Allowing dynamic changing of the address class attribute.
Raise exception when an invalid URL is provided.