Type Summary





Type Summary


CF public sealed class WebClient : Component

       {

       // Constructors

       CF public WebClient();



       // Properties

       CF public string BaseAddress { get; set; }

       CF public ICredentials Credentials { get; set; }

       CF public WebHeaderCollection Headers { get; set; }

       CF public NameValueCollection QueryString { get; set; }

       CF public WebHeaderCollection ResponseHeaders { get; }



       // Methods

       CF public byte[] DownloadData(string address);

       CF public void DownloadFile(string address, string fileName);

       CF public Stream OpenRead(string address);

       CF public Stream OpenWrite(string address);

       CF public Stream OpenWrite(string address, string method);

       CF public byte[] UploadData(string address, byte[] data);

       CF public byte[] UploadData(string address, string method, byte[] data);

       CF public byte[] UploadFile(string address, string fileName);

       CF public byte[] UploadFile(string address, string method,

                        string fileName);

       CF public byte[] UploadValues(string address, NameValueCollection data);

       CF public byte[] UploadValues(string address, string method,

                        NameValueCollection data);

       }


KC WebClient is an example of what we call "Aggregate Component". It's a façade on top of several different fine-grained—but at the same time more complex—APIs. It provides an easy single entry point to the most common functionality related to the System.Net namespace. With a library as extensive as the one in the framework, we observed that the most common and severe usability problems include problems with finding the type that the user needs to use and problems with initializing and hooking up several fine-grained objects just to do some very basic things. To address the problem, we added several Aggregate Components to some core namespaces.

JM Component, which WebClient derives from here, does not exist in the ECMA standard. Instead, the ECMA standard has it derived from System.Object.

LO Future versions of WebClient will include support for submitting requests asynchronously.



     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows