I'd like to be able to modify the url contained in the RequestUri of a c# HttpWebRequest object. I'd like to append an additional parameter with a ticket Id. [like &ticket=xyz123]
It sounds like this may not be possible to do this because RequestUri is read only. Some people have suggested using reflection to get around it, but others say that even when you use reflection it won't work.
Is there some other way to get around this?
Would I be able to use the HttpWebRequest CookieContainer to include the ticket information -- although the ticket is not in a cookie, there is a special service call needed to retrieve the ticket string.
I'm trying to override an authentication method as follows:
protected override void HttpAuthenticate(HttpWebRequest request)
{
Uri uri = request.RequestUri;
Uri newUrl = new Uri(AuthData.appendTicket(uri.ToString()));
request.RequestUri = newUrl; // Cannot do this because it is readonly