public WebApiRequest AddContentType(ContentType contentType)
{
string contentTypeString;
switch (contentType)
{
case ContentType.Json:
contentTypeString = "application/json";
break;
case ContentType.Xml:
contentTypeString = "text/xml";
break;
default:
contentTypeString = "application/x-www-form-urlencoded";
break;
}
headers.Add("Content-Type", contentTypeString);
return this;
}