"Error: SendFailure (error record headers)"

I am trying to get data in "xamarin studio" using the "rest sharp" package, for example:

var client = new RestClient ("https://xxxx.xxxx.com"); var request = new RestRequest ("/api/external/xxxx/xxxx/", Method.GET); request.AddParameter("username", "xxxx"); request.AddParameter("api_key", "xxxx"); request.AddHeader("Content-type", "application/json"); request.AddHeader("Accept", "text/plain"); request.RequestFormat = DataFormat.Json; var response = client.Execute (request); var model = JsonConvert.DeserializeObject<RootObject> (response.Content); 

The error I get is

Error: SendFailure (error record headers)

I really don't know what is wrong. I am using 64-bit windows windows.

Please help ... Thanks for the promotion!

+5
source share
1 answer

This is probably due to certificate errors. Can you test using direct HTTP? Or install the application to ignore certificate verification, as described here .

+1
source

Source: https://habr.com/ru/post/1204166/


All Articles