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.