A: 

Why are you inspecting the request stream for query string parameters? There are a lot of built in types within .Net to deal with HTTP Requests. You can easily get a proper NameValueCollection from the querystring with the following code;

NameValueCollection queryStringValues =
    HttpUtility.ParseQueryString(HttpContext.Current.Request.Query.ToLower());

string value = queryStringValues["my_key"];

In your code you have a StreamReader read the stream and assign this to a string variable called contents. However when you assign the value to string a you access a variable called context which I assume is really HttpContext.Current. You then use the Request object as a NameValueCollection. When you access the Request collection like that it looks for both POST and GET parameters checking both Request.Form and Request.QueryString.

Unless something further up the HTTP request pipeline is changing the request enroute you won't loose parameters. Use a proxy tool like Fiddler or Charles to inspect the request as it leaves the browser.

Dave Anderson
Thanks for your reply. I wasn't checking for query string parameters, I was checking the Request for either GET or POST data (i.e. Content-Type: application/x-www-form-urlencoded). In this circumstance, the data is POST-ed, so I'd expect using the Request[] indexer to check both the QueryString and Form collections. But it doesn't seem to. I'm currently getting around it by using GET parameters instead incidently, but I'd much prefer to use POST if I could get it working correctly.