The server-side HTTP request Class HttpWebRequest relative to the client HTTP request class is HttpRequest. The request properties of the HttpApplication, HttpContext, Page, UserControl classes are instances of the HttpRequest class. The HttpRequest class enables ASP. NET to read HTTP values sent by clients (such as browsers or client programs that use the HttpWebRequest Class) during Web requests. Common HTTP values are URL parameters that the client has sent by way of a get, form items and files submitted by post, and unusual HTTP values are entity principal content. For example, in the previous about HttpWebRequest introduction, it is necessary to write content to the HTTP entity body when the payment is consolidated, and it is unclear how the end receives the HTTP entity body. However, if it is an ASP. HttpRequest class's InputStream attribute, the system will callback a specific interface file in the merchant background after the payment is successful to notify the merchant background that the current order has been paid, and when the callback is made, the system writes an XML string in the entity body to that particular interface file. To simulate the acquisition of an HTTP entity body content as follows:
Send side:
Httphelper.gethtml ("<xml>data</xml>", "Http://www.xxx.com/test.aspx?key=value");
Receiving end:
StreamReader reader = new StreamReader (request.inputstream);
String xmlstr = reader. ReadToEnd ();
C # Service-Side HTTP request HttpRequest