0

How do I translate this cURL command to RestSharp:

curl -k -d . -o SessionRequest.txt 
"https://myserver.com/MyWebAPI/user?
companysn=12345&
login=MyLoginName&
password=MyPassword&
ApiKey=MyApiKey"

I tried this but it did not work (got Internal Server Error):

RestClient client = new RestClient();
client.BaseUrl = new Uri("https://myserver.com/MyWebAPI/" + "user?");
RestRequest request = new RestRequest();
request.AddQueryParameter("companysn", "12345");
request.AddQueryParameter("login", "MyLoginName");
request.AddQueryParameter("password", "MyPassword");
request.AddQueryParameter("ApiKey", "MyApiKey");
response = await client.ExecuteTaskAsync(request, new System.Threading.CancellationToken());

It seems I have to include the "-k" and the "-d ." to RestSharp but how do I do it?

Thanks

user1523271
  • 1,005
  • 2
  • 13
  • 27
  • -k is using insecure over https and -d is something I cannot find. Using self-signed certificates is described https://stackoverflow.com/questions/10397736/restsharp-ignore-ssl-errors – Alexey Zimarev Oct 16 '17 at 17:58
  • Possible duplicate of [RestSharp - Ignore SSL errors](https://stackoverflow.com/questions/10397736/restsharp-ignore-ssl-errors) – Alexey Zimarev Oct 16 '17 at 17:58

0 Answers0