The RestRequest class expects two arguments: string and method. I can see you are only passing the method.
Eg:
public RestRequest(string? resource, Method method = Method.Get)
Please pass the string also. The string can be the endpoint of the API you are testing.
Please find the below code, which I used for public API, it should be working.
public void GetBookingDetails1()
{
var restClient = new RestClient("https://restful-booker.herokuapp.com");
var request = new RestRequest("/booking/1", Method.Get);
request.AddHeader("accept", "application/json");
var response = restClient.Execute(request);
}
The RestRequest class expects two arguments: string and method. I can see you are only passing the method. Eg:
Please pass the string also. The string can be the endpoint of the API you are testing.
Please find the below code, which I used for public API, it should be working.