I am currently using context.Request.QueryString within my C# handler (.ashx), because until now I only needed to handle GET posts.
Though what if I am sent a JSON object through POST method? I know I am supposed to deserialize what's sent, but my point is - how can I know if the sending source sent POST or GET.
Why? Because I want to split the handler to POST related functions (things that require security, usually) and to the more primite GET related functions (retrieving public information, etc)
If it matters, my code looks like this now (and it is not ready to handle POSTs properly).
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "application/json";
JavaScriptSerializer jss = new JavaScriptSerializer();
// Wanna know POST was used here, so I can deserialize the sent JSON data
// ----
// Handling GET here, good and working
if (context.Request.QueryString["aname"] != null
&& context.Request.QueryString["type"] != null)
{
string adminName = context.Request.QueryString["aname"];
if(adminName == "test") { // Return some JSON object }
}
}