public override void FinalizeHeader()
{
base.FinalizeHeader();
String lRequestTypeString;
switch (this.RequestType)
{
case RequestType.Get:
lRequestTypeString = "GET";
break;
case RequestType.Post:
lRequestTypeString = "POST";
break;
case RequestType.Put:
lRequestTypeString = "PUT";
break;
case RequestType.Delete:
lRequestTypeString = "DELETE";
break;
case RequestType.Head:
lRequestTypeString = "HEAD";
break;
default:
throw new HttpHeaderException("Invalid Request Type specified");
}
// If connection goes thru proxy we have to provide full target Url (it is used by proxy to forward request).
// Otherwise only path (fe '/bin') is needed
// Always providing full target Url will breack the backward compatibility
this.Header.SetRequestHeader("1.1", lRequestTypeString, this.UseProxy ? this.Url.ToString() : this.Url.PathAndParams);
this.Header.SetHeaderValue("Host", this.Url.HostnameAndPort);
}
#endregion