qwe870691569
龙崽
2016-11-07 06:06

C#调用api接口返回json中错误信息一直是服务器繁忙

 /// <summary>
    /// Interface类
    /// </summary>
 public string Postdata(string postString, string url)
        {
            byte[] postData = Encoding.UTF8.GetBytes(postString);
            WebClient webClient = new WebClient();
            webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
            byte[] responseData = webClient.UploadData(url, "post", postData);
            string srcString = Encoding.UTF8.GetString(responseData);
            return srcString;
        } 
                //HomeController
                 public ActionResult login(string Name, string Pwd, int type)
        {
                 Interface inter = new Interface();
                    string hr = string.Format("Username ={0}&Password ={1}&JgRegistrationId={2}", Name, pwd, "");
                   var data = inter.Postdata(hr, "http://120.25.203.82:88/api/Session/Login");
                                        }

图片说明

json的错误信息一直都是服务器繁忙
//服务器api
Response Class (Status 200)
OK
ModelModel Schema
xk.bohou.aomulaite.app.api.model.ResponseModel[xk.bohou.aomulaite.app.api.model.response.LoginModel] {
ErrCode (string, optional): 错误信息 ,
Source (xk.bohou.aomulaite.app.api.model.response.LoginModel, optional): 数据 ,
ResultCode (string, optional): 结果状态:0成功、1失败
}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答