the nature of web applications

The nature of web applications

In the socket network programming prior to learning is based on:

  • Architecture: C / S architecture
  • Protocols: TCP / UDP protocol
  • Running in the transport layer of the OSI model,

So in a web application is based on:

  • Architecture: B / S architecture
  • Protocol: Http protocol
  • Application layer

When data needs to be transferred in binary form during transmission, conversion is performed before me: send (msg.encode ( 'utf8')) in the form of transmission, but this is not intuitive. For more intuitive, you should use bytes ( 'msg', encoding = 'utf8') and str (msg, encoding = 'utf8')

Then all web applications is essentially a socket server, and the user's browser is a client socket.

web communication principle:

  1. The browser sends a HTTP request;
  2. Server receives the request, generates an HTML document;
  3. HTML documents sent to the server to the browser as the appropriate body HTTP
  4. Browser receives corresponding HTTP, HTTP Body removed from the HTML document and display

Guess you like

Origin www.cnblogs.com/zhoajiahao/p/11354566.html