web application basics

Developing a Web application requires getting software parts to work over a widely distributed network using a disconnected protocol. The technologies underlying ASP.NET have been around for a long time, but ASP.NET puts them together in a way that makes Web development very approachable.

1.1. HTTP Requests

The communication mechanism with which Web browsers talk to Web sites is named Hypertext Transfer Protocol (HTTP). The World Wide Web as we know it today began as a research project at CERN in Switzerland. In those days, the notion of hypertext—documents linked together arbitrarily—was becoming increasingly popular. Applications such as Hypercard from Apple Computer introduced hypertext applications to a wider audience. If documents could then be linked over a network, that would revolutionize publishing. That's the reason for the development of HTTP, which lies on top of TCP/IP as an application layer.

In its original form, HTTP was meant to transfer hypertext documents. That is, it was originally intended simply to link documents together without consideration for anything like the Web-based user interfaces that are the staple of modern Web sites. The earliest versions of HTTP supported a single GET request to fetch the named resource. It then was the server's job to send the file as a stream of text. After the response arrived at the client's browser, the connection terminated. The earliest versions of HTTP supported only transfer of text streams and did not support any other sort of data transfer.

The first formal specification for HTTP was version 1.0 and was published in the mid-1990s. HTTP 1.0 added support for more complex messaging beyond a simple text transfer protocol. HTTP grew to support different media (specified by the Multipurpose Internet Mail Extensions). The current version of HTTP is version 1.1.

As a connection protocol, HTTP is built around several basic commands. The most important ones you see in developing ASP.NET applications are GET and POST, but other important HTTP commands not as commonly used within ASP.NET include HEAD and PUT.

GET retrieves the information identified by the Uniform Resource Identifier (URI) specified by the request. The HEAD command retrieves only the header information identified by the URI specified by the request (that is, it does not return a message body). You use the POST method to make a request to the server that might cause side effects, such as when you send information to the server for it to process. PUT is also used to send information to the server, but in the sense of documents and records versus request parameters, as is typically the case for POST when related to HTML page requests. You make most initial contacts to a page using a GET command, and you commonly handle subsequent interactions using POST commands.

0 comments: