I'm trying to Post an OFX request to a bank server with RestSharp. I have succeeded in getting the desired transaction data from the server. However, when the request body exceeds 1024 bytes, an Expect header is being added to the request. Normally, I'd just avoid the complexity and try to keep the request under 1024 bytes, but that is unavoidable with a few of the queries I want to run.
Unfortunately, the server does not support expect headers and throws an error if it receives one. I have been unable so far to identify how to prevent RestSharp from adding the Expect header. The code I'm using looks roughly like what I have below:
var client = new RestClient("https://bankwebsite.com");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-ofx");
request.AddHeader("Accept", "*/*, application/x-ofx");
request.AddParameter("application/x-ofx", ofxString, ParameterType.RequestBody);
var response = client.Execute(request);
Is there a setting I'm missing? Is this intrinsic to how these requests are formed? I'm relatively new to working with HTTP, so I'm most likely missing something. I've tried setting ServicePointManager.Expect100Continue to false, which didn't change any behavior.
Using HttpClient instead of RestSharp has caused huge issues, so I would like to avoid that if I can.
I'm using RestSharp 106.2.1 with .Net Core 2.0 on MacOS.