示例#1
0
        protected virtual JObject PostAction2(AipHttpRequest2 aipReq)
        {
            var     respStr = SendRequet2(aipReq);
            JObject respObj;

            try
            {
                respObj = JsonConvert.DeserializeObject(respStr) as JObject;
            }
            catch (Exception e)
            {
                // 非json应该抛异常
                throw new AipException(e.Message + ": " + respStr);
            }

            if (respObj == null)
            {
                throw new AipException("Empty response, please check input");
            }

            return(respObj);
        }
示例#2
0
 protected string SendRequet2(AipHttpRequest2 aipRequest)
 {
     return(aipRequest.ContentEncoding.GetString(aipRequest.GenerateDevWebRequest(Token)));
 }