http Overview --http a note

Before wants in-depth understanding of learning under HTTP, so I bought a brick "HTTP Definitive Guide." Has recently been looking at, but found that only read input and no output, no. So we intend to own understanding written as a series of notes for later read.

Probably drew a mind map of this chapter Zhang :( painters slag slag, the word ugly (⊙﹏⊙) b) will chant ~
browserFlow

The first chapter outlines HTTP is actually a brief overview of each chapter next point.

Can be summed up in this chapter: web client and server-side connection is established by establishing a successful connection to pass a request through HTTP, multimedia resources needed to get to a specific location of the server, and then return to the web client.

1.HTTP-- Internet multimedia messenger

HTTP is actually a web client and server messenger. Popular can be understood: the user to buy things in Jingdong, the courier would act as a messenger. Here is the user's web client, Jingdong is the server, and the courier is our HTTP up.

2.web client and server

Web client and server mentioned above, under normal circumstances, we visit a page with a browser will involve HTTP, and we act as a web browser on the client, and then enter the URL of sending a request to access far end server to obtain the resources needed, while the server is to store all kinds of container resources, server gets the request, the browser you want to know what, you tell the browser in response to the request , the Explorer needs to be returned to it, the browser You can display beautiful interface.

3. Resource

Speaking of just, web server is stored in the container resource. There are many resources, such as general static files: text files, HTML files, etc., there are other non-static files, pictures, videos and so on.

  1. Resource classification type, HTTP give it added a MIME type to identify!
  • HTML formatted text by the text/htmlmarked type
  • By the plain ASCII text text/plainto mark type
  • JPEG format images from the image/jpegmarked type
  • GIF格式的图片为image/gif类型来标记< 大专栏  http概述——http笔记一br/>…
  1. 每个资源都有一个名字,HTTP用URI(统一资源标识符)进行唯一标识并进行资源定位

URI有两种形式: URL和URN

  • URL(统一资源定位符)就是对特定的服务器里的某资源找到其特定位置。URL = 方案(HTTP/HTTPS) + 服务器地址 + 服务器某个资源。
  • URN(统一资源名)就是对某个资源的唯一名称,与当前资源的位置无关。

3.事务

上面说到web客户端会发送请求,服务器会响应请求。
所以事务 = 请求命令 + 响应结果。

HTTP支持几种请求命令,这些命令称为方法;可以理解为,用户可以通过不同方式在京东上买东西,可以通过手机端,PC端,打电话购买。这些方式就称为方法啦。
列举常用的几种方法:

  • GET
  • POST
  • DELETE
  • PUT
  • HEAD

HTTP响应会携带一个状态码,用来告诉请求是否成功。可以理解为,你在京东上买东西,会告诉你是否有货,是否能立即发送等状态,这些状态可以用状态码来表示。
列举常用的几种状态码:

  • 200
  • 302
  • 404

4.报文

报文其实是一种数据结构块。HTTP的请求和响应都是由报文进行结构化之后再通信的。其实报文就等于帮请求和响应命令化了下妆。
给它们各自添加了以下部分:

  • 起始行
  • 首部
  • 主体

5.连接

HTTP就是通过建立连接之后才能让客户端和服务器端通信。这么理解,河两岸的想要互相探望怎么办,我们可以建桥梁进行人与人之间的来往。我们的连接就等于是河里桥梁。我们的TCP连接就是属于万能的桥梁~

6. web的结构组件

web客户端和服务器端进行通信可能还会经过很多的组件,比如:

  • 代理
  • 缓存
  • 网关
  • 隧道
  • Agent Agent
    component of the above sections will be mentioned later. On the first unknown, he said,

Preparation may quicken the work, learn to believe HTTP, certainly can understand the front-end can be more in-depth ~

Guess you like

Origin www.cnblogs.com/lijianming180/p/12046793.html