Answer the question
In order to leave comments, you need to log in
Why is sending a GET request not working?
Why when I type in https://helpdesk.domain/api/Task/number in the browser , the result is displayed as it should, but when in my program
WebRequest req = WebRequest.Create("https://helpdesk.домен/api/Task/номер");
//ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
req.Credentials = new NetworkCredential("Логин", "пароль");
WebResponse resp = req.GetResponse();
Stream stream = resp.GetResponseStream();
StreamReader sr = new StreamReader(stream);
string Out = sr.ReadToEnd();
sr.Close();
Console.WriteLine(Out);
Console.ReadLine();
Удаленный сервер возвратил ошибку: (400) Недопустимый запрос."
Answer the question
In order to leave comments, you need to log in
open chrome
press F12
go to network section
now submit your request in chrome
see what the headers were in the request
maybe something needs to be added
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question