hello. i am hosting an asp.net core .net 6 webapi on glitch it does a very simple work which is return client ip address and is a test project. It is working perfectly fine in browser but i want to use it as an api for my unity game so the server need to called from c# client.
Now the problem is, that when i call the server from c# client with this code -
HttpClient client = new HttpClient();
string response = await client.GetStringAsync(url);
System.Console.WriteLine(response);
i get a 403(forbidden) error.
Alternatively, when i try to access it with this code -
HttpClient client = new HttpClient();
string response = await
(await client.GetAsync(url)).Content.ReadAsStringAsync();
System.Console.WriteLine(response);
i get the html code of the waking up page of glitch.
i also tried to use the websocket client method in c# client but it is not working too…
Kindly help. Plz share the solution and if you can code too, or if you can give the link to solution webpage.
Sorry for any grammatical mistakes.