Golang HTTP Server Analysis (1)--Overview

Source: Internet
Author: User

Golang streamlined and intuitive design, allowing web development and writing print "Hello world" identical. It also gives me a chance to get a glimpse of the design and implementation of HTTP Server. So far, before Tomcat, Apache and other web containers gave me the mystique swept away.

1. Basic knowledge

The purpose of HTTP server is to implement HTTP Protocol, let's briefly describe the HTTP Protocol.

An HTTP message consists of a single line of simple strings. HTTP messages are plain text and are the carrier of web information transmission. The following is a simple scenario for representing the HTTP message format.

The first step: the user input information username=harry&password=1234, the browser sends the POST request to the Http://localhost:8080/login, sends the message to

POST /login http/1.1

Host:localhost:8080/login

Accept:text/html

username=yasun&password=1234

The second step: the server returns the login information of the personal blog page information, send response message for

Step three: Users click on Blog 1, the browser sends a GET request

2. Design Ideas

Golang HTTP Server Analysis (1)--Overview

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.