Asp. NET core object of HttpResponse

Source: Internet
Author: User

Context. response.charset;//Gets or sets the HTTP character set of the output stream
context. response.contenttype;//Gets or sets the HTTP MIME type of the output stream
context. response.cookies;//Gets the response Cookie collection
context. response.end;//terminates execution of the Httphamdler
context. response.expires;//Gets or sets the number of minutes before the cached page expires in the browser
context. Response.headers;//gets the collection of response headers
context. response.isclientconnected;//gets a value that indicates whether the client is still connected to the
context on the server. The response.output;//enables text output to the output HTTP response stream
context. response.redirect;//redirects the request to the new URL and specifies the new URL
context. response.redirectlocation;//Gets or sets the value of the Http location header
Context. response.setcookie;//updates an existing cookie in the collection of cookies
context. The response.status;//setting returns to the Status bar of the client
context. response.statuscode;//Gets or sets the HTTP status code
context for the output returned to the client. response.statusdescription;//Gets or sets the HTTP status string
context for the output returned to the client. response.substatuscode;//Gets or sets the value of a qualified response status Code
context. response.suppresscontent;//Gets or sets a value that indicates whether HTTP content is sent to the client
context. response.write;//writes a string or other type to the HTTP response output stream
context. response.writefile;//writes the specified file directly to the HTTP response output stream

Context. Response.End ();//Terminate Httphamdler execution, this sentence is written in a method, call this method after the code is no longer executed downward, commonly used in a method, pay attention to the difference between return, return just terminate a method;
In this way, you can catch exceptions.
Try
{
Context. Response.End ();
}
catch (Exception ex)
{

}
Because the exception processing efficiency is low, so can do without response.end ();

Asp. NET core object of HttpResponse

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.