public void SetContent(byte[] content, String encoding, FormatType? format)
{
if (null == content)
{
Headers.Remove("Content-MD5");
Headers.Remove("Content-Length");
Headers.Remove("Content-Type");
ContentType = null;
Content = null;
Encoding = null;
return;
}
String contentLen = content.Length.ToString();
String strMd5 = ParameterHelper.Md5Sum(content);
FormatType? type = FormatType.RAW;
if (null != format)
{
ContentType = format;
type = format;
}
this.Headers.Add("Content-MD5", strMd5);
this.Headers.Add("Content-Length", contentLen);
this.Headers.Add("Content-Type", ParameterHelper.FormatTypeToString(type));
this.Content = content;
this.Encoding = encoding;
}