Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
1.6 kB
3
Indexable
Never
 PostJob("https://traodoisub.com/view/tangxu/tangxu.php", $"usernhan={tknhan}&xutang={num}", "https://traodoisub.com/").Result;
 public Task<string> PostJob(string url, string data, string referer = "")
        {
            var restk = Task.Run(async () =>
            {
                try
                {
                    RestRequest request = new RestRequest(url); //request.Timeout = _Timeout;
                    request.AddHeader("accept", "application/json, text/javascript, */*; q=0.01");
                    request.AddHeader("sec-fetch-site", "same-origin");
                    request.AddHeader("sec-fetch-dest", "empty");
                    request.AddHeader("accept-language", "vi-VN,vi;q=0.9,fr-FR;q=0.8,fr;q=0.7,en-US;q=0.6,en;q=0.5");
                    request.AddHeader("X-Requested-With", "XMLHttpRequest");
                    request.AddHeader("Pragma", "no-cache");
                    request.AddHeader("Cache-Control", "no-cache");
                    request.AddHeader("sec-fetch-mode", "cors");
                    request.AddHeader("referer", referer);
                    request.AddHeader("sec-ch-ua-platform", "\"Windows\"");
                    if (!string.IsNullOrEmpty(data))
                        request.AddStringBody(data, "application/x-www-form-urlencoded");
                    request.Method = Method.Post;
                    var res = await Client.ExecuteAsync(request);
                    html = res?.Content;
                    return res?.Content;
                }
                catch { return ""; }
            });

            return restk;
        }