C # Service-Side HTTP request HttpRequest

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.