官术网_书友最值得收藏!

Hypertext Transfer Protocol 

Hypertext Transfer Protocol (HTTP) is the foundation of communication on the WWW. It defines the format of messages and the way they are transmitted between the client and the server.

HTTP has two sides to communication — the client and the server. On web applications, the client is the user's web browser and the server is the backend server. Communication happens when the client creates a message called an HTTP request, sends it to the server, and the server, in turn, responds with an HTTP response, as shown in the following diagram:

Each HTTP request consists of a few pieces of information:

  • URI: The web address or IP address that identifies the server. For example, http://example.com or http://192.168.0.1.
  • Method: The action that should be taken upon the requested resource. For example, GET indicates data retrieval and POST indicates data creation.
  • Body: Contains the data to be sent to the server, if any. The most popular data format for HTTP requests is JSON but, generally, data can be formatted in any format that the server understands.
  • Headers: An optional set of metadata key-value pairs that add information to a request.

The server retrieves this request, executes related logical steps (commonly known as business logic), and forms an HTTP response to be sent back to the client. This response includes a few details:

  • Status code: A three-digit integer that describes the result of the request. For example, 200 means OK, 500 means there was an error in the server, and 404 means the requested resource was not found.
  • Body: The data sent back from the server, if any. As with the request body, JSON is the common data format, but any other format is valid as well.
  • Headers: An optional set of metadata key-value pairs that add information about the response.
主站蜘蛛池模板: 石台县| 额济纳旗| 汾阳市| 吉安县| 泾川县| 昌江| 通道| 沙坪坝区| 南江县| 南开区| 元氏县| 兴山县| 鄂尔多斯市| 鲁山县| 海门市| 南川市| 北票市| 和林格尔县| 牙克石市| 牡丹江市| 江门市| 天峨县| 乐都县| 基隆市| 克拉玛依市| 牙克石市| 将乐县| 精河县| 玉树县| 铜山县| 和田县| 磴口县| 台南市| 陆良县| 娄烦县| 怀远县| 天柱县| 武功县| 景东| 运城市| 汝阳县|