I have a library which callers use to send HTTP requests by giving me HttpUriRequest (Apache HTTP client) objects. In some cases due to some tunneling which should be transparent to the caller, I need to modify the URL of the request to use HTTP instead of HTTPS.
How might I go about doing this? It seems like I can't just change it right on the object. The only thing I can see is to create a new HttpUriRequest object that is a clone of the other but with the URL changed.
Is there a better way?