public DWR_Request(DWR_Session dwr_Session, string scriptName, string methodName, params string[] parameters) : this(dwr_Session)
 {
     CallCount  = 1;
     WindowName = "";
     ScriptName = scriptName;
     MethodName = methodName;
     Id         = 0;
     BatchId    = 0;
     Page       = "";
     Parameters = (parameters.notNull() && parameters.size() > 0)
                                                         ? parameters.toList()
                                                         : new List <String>();
 }
        public static string makeCall_Plain(this DWR_Session dwr_Session, string cookie, string postData, Uri uri)
        {
            //show.info(dwr_Session);
            "[DWR][PlainCall] invoking: {0}".info(uri);
            var web  = new Web();
            var html = web.getUrlContents_POST(uri.str(), "", cookie, postData);

            if (dwr_Session.AutoSetCookiesAndSessionIDs && web.Headers_Response.hasKey("Set-Cookie"))
            {
                var newCookieValue = web.Headers_Response.value("Set-Cookie");
                dwr_Session.Cookie        = newCookieValue.split(";")[0];
                dwr_Session.HttpSessionId = dwr_Session.Cookie.split("=")[1];
                "Found Set-Cookie, so setting Cookie to {0} and HttpSessionId to {1}".info(dwr_Session.Cookie, dwr_Session.HttpSessionId);
            }
            return(html);
        }
        public static string makeCall_Plain(this DWR_Session dwr_Session, string cookie, string postData, string scriptName, string methodName)
        {
            var url = (dwr_Session.Url.contains(".dwr")) ? dwr_Session.Url : dwr_Session.Url + "/dwr/call/plaincall/{0}.{1}.dwr".format(scriptName, methodName);

            return(dwr_Session.makeCall_Plain(cookie, postData, url.uri()));
        }
 public static string makeCall_Plain(this DWR_Session dwr_Session, string cookie, string postData)
 {
     return(dwr_Session.makeCall_Plain(cookie, postData, "AAAAAA", "BBB"));
 }
 public API_DWR(string url)
 {
     Dwr_Session = new DWR_Session(url);
 }
 public DWR_Request(DWR_Session dwr_Session) : this()
 {
     Dwr_Session = dwr_Session;
 }