Loading

伪造IP

更改请求头,伪造IP(NET)

  using (HttpClient client = new HttpClient())
   {
		client.DefaultRequestHeaders.Add("X-Forwarded-For", "xxxip");//重点
                var res = await client.GetAsync($"xxxxx.com");
                var content = await res.Content.ReadAsStringAsync();
                if (!String.IsNullOrEmpty(content))
                {
                    JObject jo = (JObject)JsonConvert.DeserializeObject(content);
                    xxxxx
                }
                else
                {
                    return await Task.FromResult(default(List<xxx>));
                }
   }
posted @ 2022-03-30 14:09  灭霸  阅读(92)  评论(0)    收藏  举报