Click here to Skip to main content
15,851,387 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have created an app that uses RestSharp to interact with a REST API.

The same exact code that run perfectly well on my PC, returns HTML on another PC.




Thank you in advanced for any insight you might have.

What I have tried:

Things I have done:


I have checked the NuGet versions of all packages and they are the same. I have checked the .NET version to make sure they are the same.

The code looks like this but definitely two different responses.

C#
var request = new RestRequest();
var client = new RestClient();

client = new RestClient(URL);
client.Timeout = -1;
request = new RestRequest(Method.GET);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer " + token);
response = client.Execute(request);
Posted
Updated 13-Apr-23 13:31pm
v2
Comments
Graeme_Grant 13-Apr-23 18:30pm    
Have you looked at the html? Usually, it means that the URL that you are pointing to is incorrect.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900