The previous Sections introduced the process analysis of the Django request processing, and we learned that Django is around request and Response, that is, no matter "beg" and "should".
When requesting a page, Django wraps the requested metadata
In asp tutorial. net, http response information is encapsulated by the httpresponse class. This type of instance is created when the http pipeline that processes the request is created, and then the instance is linked to the httpcontext object
In asp tutorial. net, http Response Information is encapsulated by the httpresponse class. This type of instance is created when the http pipeline that processes the request is created, and then the instance is linked to the httpcontext object
Recently Old and HttpContext, HttpRequest, HttpResponse HttpRuntime, httpserverutility these objects to deal with. It's time to put them down.
A HttpRuntime exposes a static method UnloadAppDomain (), which allows us to restart the site with code.
1. request and response
These two are good buddies, always inseparable. They can be represented as follows:
Ii. HttpRequest object
A separate HTTP request from a client. The HttpRequest object is automatically created by Django.
It has many
Httpresponse class
Description:Encapsulate HTTP Response Information from ASP. NET operations.
Common constructor:
HttpresponseInitialize a new instance of the httpresponse class.
Public attributes:
BufferGets or sets a value indicating whether to
In the process of requesting data through httpclient or URLs, inevitably will appear garbled problem, the author in the project development process encountered this problem, on the Internet to find a pile of data, are in the receiving end to solve
Void downloadfrominternet (System: String URL, system: String path) {// create the httprequest request object system: Net: httprequest * request = new system: Net :: httprequest (URL); // If memory permits, the returned pointer is always available
Httpreponse is a class that is commonly used to process returned results after the server receives a request from the browser. First, the attributeBuffer Gets or sets a value that indicates whether the output is buffered and sent after the entire
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.
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.