0
是否有人有示例代碼來從Xamarin Storyboard Viewcontroller中使用RFest API。我必須使用POST方法進行身份驗證。我總是得到超時錯誤。從Xamarin Storyboard ViewController中使用resume rest API的示例代碼
是否有人有示例代碼來從Xamarin Storyboard Viewcontroller中使用RFest API。我必須使用POST方法進行身份驗證。我總是得到超時錯誤。從Xamarin Storyboard ViewController中使用resume rest API的示例代碼
這裏是我的示例代碼,您正在使用
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
request.Credentials = new NetworkCredential("Test1", "Pw1232");
using (var response = (HttpWebResponse)request.GetResponse())
{
var stream = response.GetResponseStream();
var reader = new StreamReader(stream);
string apiResponse = reader.ReadToEnd();
new UIAlertView("Test API", apiResponse, null, "cancel", null);
}
代碼? – SushiHangover