我正在尝试使用RestSharp库调用REST服务。该代码在Windows环境中完美运行。但是,当我尝试在Mac上执行代码(对于iOS)时,我收到错误
“获取响应流时出错(chunked Read1):ReceiveFailure”
我正在使用的代码是:
var client = new RestClient("http://domain.com");
var request = new RestRequest("_api/web/lists/getbytitle('MyList')/items")
{
RequestFormat = DataFormat.Json
};
request.AddHeader("Accept", "application/json;odata=verbose");
request.Credentials = new NetworkCredential(@"domain\username", "password");
var response = client.Execute(request);
我正在使用MacMini和MonoTouch 3.1.1