从HTTP POST获取Querystring?

001*_*001 4 c# api web-services restful-authentication

这段代码似乎是从HTTP Get中获取查询字符串...

HttpContext.Current.Request.QueryString.ToString();
Run Code Online (Sandbox Code Playgroud)

如何从HTTP POST获取查询字符串?

RPM*_*984 16

一样的方法.

HttpContext.Current.Request.QueryString["somekey"]
Run Code Online (Sandbox Code Playgroud)

这两个GETPOST在请求的查询字符串.只有POST有表单数据.

你不应该这样做QueryString.ToString().这将评估NameValueCollection中的所有键.您应该使用索引器来检索所需的键,或使用Keys属性枚举.