Client-Ser ver Communications AJAX client-server truyền thông lớp bao gồm các loại quan trọng được thảo luận trong chương này. Những loại thi đua / NET đối tác, cho phép bạn sử dụng kỹ thuật lập trình mạng tương tự như máy chủ bên trong lập trình mạng lưới khách hàng của bạn. Các kiểu trong AJAX lớp giao tiếp khách hàng-máy chủ thuộc về không gian tên sau đây: ( ');. | Client-Server Communications The AJAX client-server communication layer consists of several important types that are discussed in this chapter. These types emulate their .NET counterparts which enables you to use similar server-side network programming techniques in your client-side network programming. The types in the AJAX client-server communication layer belong to the following namespace WebRequest The AJAX WebRequest client class represents a Web request that the client-side code makes to the server. The following sections discuss the important members of this class. Constructor As you can see in Listing 12-1 the WebRequest constructor defines the following fields _url A string that contains the target URL for the request. _headers A dictionary that contains the names and values of the request headers. _body A string that contains the body of the request. _userContext Contains a JavaScript object that provides application-specific contextual information. _httpVerb A string that contains the HTTP verb being used to make the request. _executor A field of type WebRequestExecutor that references the WebRequestExecutor object responsible for executing the request. The WebRequestExecutor base class and its subclasses are discussed later but for now suffice it to say that every WebRequest object is associated with a WebRequestExecutor object whose main responsibility is to execute or make the request. Chapter 12 Client-Server Communications _invokeCalled A Boolean value that ensures that the request is executed or made only once. _timeout The field that specifies the request timeout. The request automatically gets canceled if the server response does not arrive within the time interval specified by this field. Listing 12-1 The Constructor of the WebRequest Class function Sys Net WebRequest null null null