Exemplo n.º 1
0
        public static void SendPayload(string payload)
        {
            Dictionary <string, string> headers = new Dictionary <string, string> {
                { "User-Agent", $"Oxide/{OxideMod.Version} ({Environment.OSVersion}; {Environment.OSVersion.Platform})" }
            };

            Webrequests.Enqueue(url, Uri.EscapeUriString(payload), (code, response) => { }, null, RequestMethod.POST, headers);
        }
Exemplo n.º 2
0
        private static void SubmitNextReport()
        {
            if (QueuedReports.Count < 1)
            {
                return;
            }

            QueuedReport queuedReport = QueuedReports[0];

            submittingReports = true;
            Webrequests.Enqueue(Url, queuedReport.Body, (code, response) =>
            {
                if (code == 200)
                {
                    QueuedReports.RemoveAt(0);
                    submittingReports = false;
                    SubmitNextReport();
                }
                else
                {
                    Timers.Once(5f, SubmitNextReport);
                }
            }, null, RequestMethod.POST, queuedReport.Headers);
        }