Network
什么是Socket
TCP/IP三次握手
什么是HTTP
The Hypertext Transfer Protocol (HTTP) is an application protocol for distributed, collaborative, hypermedia information systems.
HTTP is the foundation of data communication for the World Wide Web. Hypertext is structured text that uses logical links (hyperlinks) between nodes containing text. HTTP is the underlying protocol used by the World Wide Web.
HTTP defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands.
http是一个应用层协议,是互联网的基础。 HTTP定义了信息是以何种格式传播的, 也定义了服务器和浏览器应如何队不同的命令做出反应。 http依赖可靠传输协议,所以它是使用tcp (Transmission Control Protocol)协议的。
http依赖可靠传输协议,所以它是使用tcp (Transmission Control Protocol)协议的。
什么是API
an application program interface(API)
API is interface which has a set of functions that allow programmers to access specific features or data of an application, operating system or other services.
Web API is an API over the web which can be accessed using HTTP protocol. It is a concept and not a technology.
在输入框里输入google.com之后会发生什么
1 向DNS (Domain Name System) 发送请求,得到IP地址
2 向web server 发送http请求
3 web server 处理请求,并发送response
4 得到response
Process of DNS:
- Check local Hosts file
- Ask DNS server
- Check itself or ask others
- Send IP address back
TCP 和 UDP有什么区别
TCP(Transmission Control Protocol). TCP is a connection-oriented protocol, a connection can be made from client to server, and from then on any data can be sent along that connection.
Reliable - when you send a message along a TCP socket, you know it will get there unless the connection fails completely. If it gets lost along the way, the server will re-request the lost part. This means complete integrity, things don't get corrupted.
Ordered - if you send two messages along a connection, one after the other, you know the first message will get there first. You don't have to worry about data arriving in the wrong order.
Heavyweight - when the low-level parts of the TCP "stream" arrive in the wrong order, resend requests have to be sent, and all the out of sequence parts have to be put back together, so requires a bit of work to piece together.
UDP(User Datagram Protocol). A simpler message-based connectionless protocol. With UDP you send messages(packets) across the network in chunks.
Unreliable - When you send a message, you don't know if it'll get there, it could get lost on the way.
Not ordered - If you send two messages out, you don't know what order they'll arrive in.
Lightweight - No ordering of messages, no tracking connections, etc. It's just fire and forget!
This means it's a lot quicker, and the network card / OS have to do very little work to translate the data back from the packets.
HTTP methods supported by REST?
GET: It requests a resource at the request URL. It should not contain a request body as it will be discarded. May be it can be cached locally or on the server.
POST: It submits information to the service for processing; it should typically return the modified or new resource
PUT: At the request URL it update the resource
DELETE: At the request URL it removes the resource
OPTIONS: It indicates which techniques are supported
HEAD: About the request URL it returns meta information
http://blog.csdn.net/bruce_6/article/details/39499439
http://wdxtub.com/interview/14520596959731.html