Talk, guys!
Next, I developed a spring boot api and I already tested it with the postman and it is working normally, its security is very basic auth authentication. Now I am testing in a C # application that I have here to return the token to be able to consume the endpoints, however when I am making the call to return the token it is returning me:
"System.Net.WebException: 'O servidor remoto retornou um erro: (400) Solicitação Incorreta.'"
Follow the code below:
WebRequest req = WebRequest.Create(@"http://localhost:8080/oauth/token");
req.Method = "POST";
req.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.Default.GetBytes("apisustentacao:HHednf8iwFgre$$$@"));
HttpWebResponse resp = req.GetResponse() as HttpWebResponse;
No postman is working normally:
BelowismorepostmanHeaderimage:
Thanks to anyone who can help me