A complete web application: server receives a request from the browser, the web server will return the requested content to the browser so that the browser is displayed. [And before the browser and the server transport protocol is HTTP]
http: html is transmitted over the network protocol used to communicate the browser and server.
html: One definition is the text of the page.
Common status codes!
200 ok request was successful. GET and POST requests are generally used for
404 not found the server can not find the resources (web) at the request of the client. By this code, web designers can set "you can not find the requested resource" personalized page
500 Internal Server Error Internal server error and can not fulfill the request
Content-Type (content type), generally refers to the Content-Type web pages exist for defining network file encoding type page, the browser will decide what form, what code reading this document, which is often seen Some of the results to the PHP page is clicked to download a file or a picture reasons.
Content-Type header tells the client to return the actual content type of the content.
Syntax:
Content-Type: text/html; charset=utf-8 Content-Type: multipart/form-data; boundary=something
content-type:application/javascript
WSGI: web Server Gateway interface [web server gateway interface]
Principle: Request web developers to implement a function, it can respond to http requests.
example:
def application(environ , start_response):
start_response('200 ok',[('Content-Type','text/html')])
return '<h1>hello ,web</h1>'
environ: a http request containing all the information dict objects
start_response: sending a http response function
In the application () function: Call:
start_response('200 ok',[('Content-Type','text/html')])