Type Summary

Type Summary

   public class HttpWebRequest : WebRequest, ISerializable


       // Constructors

    MS CF protected HttpWebRequest(SerializationInfo serializationInfo,

                    StreamingContext streamingContext);

       // Properties

          public string Accept { get; set; }

          public Uri Address { get; }

          public bool AllowAutoRedirect { get; set; }

          public bool AllowWriteStreamBuffering { get; set; }

    MS CF public X509CertificateCollection ClientCertificates { get; }

          public string Connection { get; set; }

       CF public override string ConnectionGroupName { get; set; }

          public override long ContentLength {get; set;  }

          public override string ContentType { get; set; }

          public HttpContinueDelegate ContinueDelegate { get; set; }

    MS CF public CookieContainer CookieContainer { get; set; }

          public override ICredentials Credentials { get; set; }

MS CF 1.1 public static int DefaultMaximumResponseHeadersLength { get; set; }

          public string Expect { get; set; }

          public bool HaveResponse { get; }

          public override WebHeaderCollection Headers { get; set; }

          public DateTime IfModifiedSince { get; set; }

          public bool KeepAlive { get; set; }

          public int MaximumAutomaticRedirections { get; set; }

MS CF 1.1 public int MaximumResponseHeadersLength { get; set; }

          public string MediaType { get; set; }

          public override string Method { get; set; }

          public bool Pipelined { get; set; }

          public override bool PreAuthenticate { get; set; }

          public Version ProtocolVersion { get; set; }

          public override IWebProxy Proxy { get; set; }

MS CF 1.1 public int ReadWriteTimeout { get; set; }

          public string Referer { get; set; }

          public override Uri RequestUri { get; }

          public bool SendChunked { get; set; }

          public ServicePoint ServicePoint { get; }

         public override int Timeout { get; set; }

          public string TransferEncoding { get; set; }

MS CF 1.1 public bool UnsafeAuthenticatedConnectionSharing { get; set; }

          public string UserAgent { get; set; }

       // Methods

          public override void Abort();

          public void AddRange(int range);

          public void AddRange(int from, int to);

          public void AddRange(string rangeSpecifier, int range);

          public void AddRange(string rangeSpecifier, int from, int to);

          public override IAsyncResult BeginGetRequestStream(

                                       AsyncCallback callback,

                                       object state);

          public override IAsyncResult BeginGetResponse(AsyncCallback callback,

                                       object state);

          public override Stream EndGetRequestStream(IAsyncResult asyncResult);

          public override WebResponse EndGetResponse(IAsyncResult asyncResult);

       CF public override int GetHashCode();

          public override Stream GetRequestStream();

          public override WebResponse GetResponse();

       // Explicit Interface Members

    MS CF void ISerializable.GetObjectData(

               SerializationInfo serializationInfo,

               StreamingContext streamingContext);


LO We've gone through years of debate over whether or not HttpWebRequest should have a public constructor. The original intention was to make it so that everyone goes through the WebRequest.Create mechanism so that Create can be used reliably as an interception mechanism. In hindsight, many developers have indicated they'd like to have the option of constructing the class directly. It is likely that we'll put a public constructor in a future version.

LO Note, in the future there will be an overload for AddRange that takes a long. In the meantime, don't request a range that is above 2 GB.

LO The history on UnsafeAuthenticationConnectionSharing: In the beginning of HttpWebRequest, it reused connections to the server whenever it could. We then discovered in the betas that because some Web servers cached NTLM connections it was possible—and in fact probable—that a client impersonating different accounts and using NTLM authentication could end up hitting the back end server using a connection that had been authenticated using a different set of credentials from the ones belonging to the currently impersonated client. To mitigate against this, HttpWebRequest was changed to close NTLM authenticated connections after use.

However, clients who weren't doing impersonation or who were aware of this issue and were using ConnectionGroupName to mitigate it didn't have a way to reuse the connection and performance suffered. UnsafeAuthenticatedConnection-Sharing was introduced as a result. It gives the developer a bit to flip to get back the performance wins of caching NTLM authenticated connections.

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