public System.Net.Http.HttpResponseMessage PostData(string controller, string action, string formToken = "")
 {
     if (FormTokenUtility.ValidateFormToken(formToken, HttpContext.Current.Session.SessionID))
     {
         SingleActionSettingDTO setting = new SingleActionSettingDTO(new HttpRequestWrapper(HttpContext.Current.Request), base.PortalSettings.PortalId);
         //when calling main api from client application, there  is no need to pass formToken to main bpms api.
         string url = UrlUtility.GetApiUrl(setting.WebApiAddress, action, controller, "", this.GetParameters().ToArray());
         return(ApiUtility.PostData(url, QueryModel.GetFormDataList(this.MyRequest).ToList(), setting.WebServicePass, base.UserInfo.Username, ApiUtility.GetIPAddress(), HttpContext.Current.Session.SessionID, FormTokenUtility.GetIsEncrypted(formToken, HttpContext.Current.Session.SessionID)));
     }
     else
     {
         throw new System.Web.Http.HttpResponseException(System.Net.HttpStatusCode.Unauthorized);
     }
 }