I'm hooking into the Salesforce Bulk API using RestSharp.
When I add an object using AddBody:
var request = new RestRequest( Method.POST);
request.RequestFormat = DataFormat.Xml;
request.AddHeader("X-SFDC-Session", loginresult.SessionID);
var ji = new jobInfo { operation = "insert", @object = "contact", contentType = "CSV" };
request.AddBody(ji, xmlns);
Salesforce rejects it with this error message:
Unsupported content type: text/xml
... presumably because behind the scenes RestSharp is interpreting request.RequestFormat = DataFormat.Xml; as "text/xml".
By fiddling around with the Salesforce API I have discovered that it wants "application/xml" instead of "text/xml".
Is there a supported way to make RestSharp send "application/xml" instead?