public WebRequests CreateWebRequest(string validationURL)
        {
            WebRequests r = new WebRequests();

            r.url = validationURL;
            r.InitialiseRequest();
            r.request.Method    = "GET";
            r.request.UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1";
            r.request.Timeout   = 10000;
            return(r);
        }
Exemple #2
0
        private WebRequests CreateWebRequest(string url)
        {
            WebRequests r = new WebRequests();

            r.url = url;
            r.InitialiseRequest();
            r.UI                = UI;
            r.request.Method    = "POST";
            r.request.UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1";
            return(r);
        }
Exemple #3
0
        public WebRequests CreateWebRequestFederated(string validationURL)
        {
            UI.ThreadSafeAppendLog("[3]Checking Federated Status: " + validationURL);
            WebRequests r = new WebRequests();

            r.url = validationURL;
            r.InitialiseRequest();
            r.UI                = UI;
            r.request.Method    = "GET";
            r.request.UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1";
            r.request.Timeout   = 10000;
            return(r);
        }
        public static WebRequests CreateWebRequest(string url, MainWindow UI, HttpMethodChoice method, string accessToken)
        {
            WebRequests r = new WebRequests();

            r.url = url;
            r.InitialiseRequest();
            r.UI = UI;
            r.request.UserAgent   = "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1";
            r.request.ContentType = "application/json";
            r.request.Accept      = "application/json";
            r.request.Headers.Add("Authorization: Bearer " + accessToken);
            if (method == HttpMethodChoice.GET)
            {
                r.request.Method = "GET";
            }
            else if (method == HttpMethodChoice.POST)
            {
                r.request.Method = "POST";
            }
            return(r);
        }