Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.5 kB
8
Indexable
Never
       public string token = ""; //token eaau
       public Task<string> GraphToken(string data)
        {
            var restk = Task.Run(async () =>
            {
               try
                    {
                        if (string.IsNullOrEmpty(tokenss))
                        {
                           return "";
                        }
                        RestRequest request = new RestRequest($"https://graph.facebook.com/graphql?{data}&access_token={token}"); 
                        request.AddHeader("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9");
                        request.AddHeader("sec-fetch-site", "same-origin");
                        request.AddHeader("sec-fetch-dest", "empty");
                        request.AddHeader("accept-language", "en-US,en;q=0.9");
                        request.AddHeader("sec-fetch-mode", "cors");
                        request.AddHeader("referer", "https://www.facebook.com/");
                        request.AddHeader("sec-ch-ua-platform", "\"Windows\"");
                        request.AddHeader("User-Agent", UA);
                        request.Method = Method.Post;
                        var res = await Client.ExecuteAsync(request);
                        return res?.Content;
                    }
                    catch { return "Lỗi mạng"; }

            });
            return restk;
        }