System.Net.WebException: "The remote server returned an error: (401) Unauthorized."
Пытаюсь получить все данные из https://api.dmarket.com/exchange/v1/offers-by-title?Title=%E2%98%85%20Sport%20Gloves%20%7C%20Vice%20%28Field-Tested%29&Limit=100 Но выдает ошибку: System.Net.WebException: "The remote server returned an error: (401) Unauthorized.". Хотя я авторизовался на сайте.
Вот код
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace TEST
{
class Program
{
static void Main(string[] args)
{
string price = "";
using (WebClient wc = new WebClient())
price = wc.DownloadString("https://api.dmarket.com/exchange/v1/offers-by-
title?Title=%E2%98%85%20Sport%20Gloves%20%7C%20Vice%20%28Field-Tested%29&Limit=100");
Console.WriteLine(price);
}
}
}
Пытался вставить:
myReq.UseDefaultCredentials = true;
myReq.PreAuthenticate = true;
myReq.Credentials = CredentialCache.DefaultCredentials;
Но ничего не помогает.