tailieunhanh - wiley http essentials protocols for secure scaleable web sites phần 2

người sử dụng trang đã xác định một tập tin địa phương. Bằng cách nhấp chuột vào nút Upload, người sử dụng yêu cầu trình duyệt để gửi một yêu cầu PUT để máy chủ. xóa tập tin - DELETE Với GET, PUT hoạt động, http trở thành một giao thức phục vụ cho chuyển tập tin đơn giản. | HTTP Operation 23 Figure The PUT request may be used to upload a file to a server. In this example the user wants to store the indicated file on the server. page the user has identified a local file. By clicking on the Upload button the user asks the browser to send a PUT request to the server. File Deletion - DELETE With GET and PUT operations http becomes a serviceable protocol for simple file transfers. The DELETE operation completes this function by giving clients a way to delete objects from servers. The message exchange contains no surprises. As figure shows the client sends a DELETE message along with the URI of the object the server should remove. The server responds with a status code and optionally more data for the client. 24 HTTP Essentials Figure The DELETE operation lets a client remove an object from a server. The URI identifies the object to delete. Client 200 OK Data Behind the Scenes The basic http operations generally occur as a direct result of end-user actions. Those four operations are not the only ones the protocol defines however. Three additional operations OPTIONS HEAD and TRACE frequently take place behind the scenes. Clients use them to communicate with servers not so much to perform user actions but to prepare for or diagnose problems with the basic operations. Although this section does not discuss it further the http specification also reserves the name for another operation CONNECT. The standard does not define how CONNECT works except to indicate that it is intended to support tunneling. See section . Future extensions to http may define CONNECT in more detail. Capabilities - OPTIONS Clients can use an OPTIONS message to discover what capabilities a server supports. The exchange is the standard request and response as figure illustrates. If the client includes a URI the server responds with the options relevant to that object. If the client sends an asterisk as the URI the server returns the

TỪ KHÓA LIÊN QUAN