I've been working a lot with HTTP related things - HTTP requests, HTTP responses, HTTP methods etc., but I'm not really sure I understand what the protocol itself looks like. Is it a document like a specification?
相关问题
- Angular RxJS mergeMap types
- Google Apps Script: testing doPost() with cURL
- How to instantiate Http service in main.ts manuall
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- PHP Empty $_POST
相关文章
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- Is a unicode user agent legal inside an HTTP heade
- git: retry if http request failed
- Flutter - http.get fails on macos build target: Co
- C# HttpClient.SendAsync always returns 404 but URL
- Response body is null, status is 200
- Returning plain text or other arbitary file in ASP
- jquery how to get the status message returned by a
Hyper Text Transfer Protocol (HTTP) provides a pattern to interact with Resources (e.g. webpages on a webserver). Essentially it boils down to a Request (typically from a browser) and a Response (typically from a webserver).
The request highlighted red above identifies an action verb such as GET, POST, DELETE, or PUT (there are others verbs too) and a resource (URI/URL) to preform the action on. The request above depicts a browser request to view the wikipedia main page.
The server then responds to the request with the blue and green sections above; they represent the response header and the response body. The response header contains a lot of optional information about the server but the important fields are the status code (200 OK), the content length (54218) and the content type (text/html).
Since the content type is html the browser will try to render the html inside the response body. If the content type were something else such as a word doc then the browser would probably open a save dialog box. There are a plethora of content types that the body could represent, but not all browsers support each of the content types.
Yes, HTTP is a protocol over TCP/IP defined in the following specification: http://www.w3.org/Protocols/rfc2616/rfc2616.html
This protocol is for example implemented by web servers and client browsers.