Vladi Isakov
Vladi Isakov

Reputation: 289

"Error: SendFailure (Error writing headers)"

I'm trying to fetch data in "xamarin studio" using "rest sharp" package like so:

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 writing headers)

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

Please help... Thank you for advance!!!

Upvotes: 6

Views: 3828

Answers (1)

bbsimonbb
bbsimonbb

Reputation: 29012

This is likely due to certificate errors. Can you test using straight HTTP? Or set your app to ignore certificate checks as described here.

Upvotes: 1

Related Questions