Express the format of request and response message format. What is the role of adapter class in database connection?
The format of request and response message format is:-
HTTP
HTTP specifications concisely define messages as "requests from client to server and responses from server to client." At its most elemental level, the role of ASP.NET is to enable server-based applications to handle HTTP messages. The primary way it does this is through HttpRequest and HttpResponse classes. The request class contains the HTTP values sent by a client during a Web request; the response class contains the values returned to the client.
HTTP Request Message Format
- The Request-Line consists of three parts: the method token, the Request-URI, and the protocol version. Several methods are available, the most common being the POST and GET methods. The Uniform Resource Identifier (URI) specifies the resource being requested. This most commonly takes the form of a Uniform Resource Locator (URL) but can be a file or other resource. The protocol version closes out the Request-Line.
- The general-header is used to pass fields that apply to both requests and responses. The most important of these is the cache-control field that specifies, among other things, what can be cached and how long it can be cached.
- The request header is used by the client to pass additional information about the request, as well as the client. Most of the HttpRequest object's properties correspond to values in this header.
HTTP Response Message Format
- The server responds with a status line that includes the message's protocol version, success or error code, and a textual description of the error code. This is followed by the general header and the response header that provides information about the server. The entity-header provides metainformation about the body contents or the resource requested.
OR,
The Citrix ADC appliance does not check for the validity of the HTTP callout request. Therefore, before you configure HTTP callouts, you must know the format of an HTTP request. You must also know the format of an HTTP response because configuring an HTTP callout involves configuring expressions that evaluate the response from the HTTP callout agent.
This section includes the following sections:
- Format of an HTTP Request
- Format of an HTTP Response
Format of an HTTP Request
- An HTTP request contains a series of lines that each end with a carriage return and a line feed, represented as either <CR><LF> or \r\n.
- The first line of a request (the message line ) contains the HTTP method and target. For example, a message line for a GET request contains the keyword GET and a string that represents the object that is to be fetched, as shown in the following example:
Syntax
GET /mysite/mydirectory/index.html HTTP/1.1\r\n
The rest of the request contains HTTP headers, including a required Host header and, if applicable, a message body.
The request ends with a bank line (an extra <CR><LF> or \r\n).
Following is an example of a request:
Get /mysite/index.html HTTP/1.1\r\n
Host: 10.101.101.10\r\n
Accept: */*\r\n
\r\n
Format of an HTTP Response
An HTTP response contains a status message, response HTTP headers, and the requested object or, if the requested object cannot be served, an error message.
Following is an example of a response:
HTTP/1.1 200 OK\r\n
Content-Length: 55\r\n
Content-Type: text/html\r\n
Last-Modified: Wed, 12 Aug 1998 15:03:50 GMT\r\n
Accept-Ranges: bytes\r\n
ETag: “04f97692cbd1:377”\r\n
Date: Thu, 19 Jun 2008 19:29:07 GMT\r\n
\r\n
<55-character response>
Role of adapter class in database connection
- The DataAdapter serves as a bridge between a DataSet and a data source for retrieving and saving data.
- The DataAdapter provides this bridge by mapping Fill, which changes the data in the DataSet to match the data in the data source, and Update, which changes the data in the data source to match the data in the DataSet.
Comments
Post a Comment