I want to execute a HttpPost on a Raspberry using Mono + Restsharp.
The Httpie call that i try to reproduce in code looks something like this:
http POST https://XXXXX.azurewebsites.net/api/report key=value
This is the C# code:
RestClient nodeRed = new RestClient("http://XXXXX.azurewebsites.net/");
var request = new RestRequest("api/report", Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddBody(new { Timestamp = DateTime.Now, Data = "Test" });
request.Timeout = 5000;
var response = nodeRed.Execute(request);
The code runs fine, it is just not working. The Response does not contain any content (server response with "Success" on httpie / MS .NET Framework).
I already found out about the Certificate stuff on Mono. Running
sudo certmgr -ssl -v -m "https://XXXXX.azurewebsites.net"
Tells me it Adds two certificates on the first time. Running it again does add the first Certificate again (and again) like it is not working.
X.509 Certificate v3 Issued from: C=IE, O=Baltimore, OU=CyberTrust, CN=Baltimore CyberTrust Root Issued to: C=US, S=Washington, L=Redmond, O=Microsoft Corporation, OU=Microsoft IT, CN=Microsoft IT SSL SHA2 Valid from: 19/12/2013 20:07:32 Valid until: 19/12/2017 20:06:55 WARNING: Certificate signature is INVALID Import this certificate into the CA store ?
If i confirm and repeat the import, certmgr asks me to import again. How can i get the http post to work?