注册 登录
编程论坛 C# 论坛

简单问题请教

peng2000 发布于 2017-10-12 09:17, 1634 次点击
跟踪错误提示如下:   
 Unable to cast object of type 'System.String' to type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]
只有本站会员才能查看附件,请 登录

程序代码如下:
  
程序代码:
public string GetDetail()
        {
            string objectMame = "PO";
            string actionName = "GetDetail";
            Dictionary<string, string> dctparam = new Dictionary<string, string>();
            //GetDetail Data 请求参数 Post 需要获取单据的单据编号
            dctparam["Data"] = @"{""FBillNo"":""SMDCG170200391""}";
            byte[] postData = apiEnv.getPostData(dctparam);
            string z = GetToken();
            apiEnv.apiSession.Token = z;
            HttpResult result = apiEnv.DoAction(objectMame, actionName, postData);//主要是这句的postData的参数错误,可看附件图片的跟踪错误
            if (result.httpOk)
            {
                if (result.apiResult.StatusCode == 200)
                {
                    return result.apiResult.Data.ToString();
                }
                else
                {
                    return result.apiResult.Message;
                }
            }
            else
            {
                return "网络不通";
            }
        }
0 回复
1