You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i try to use the code snippet below, i get this message:
{System.NullReferenceException: RestClient must contain a value for BaseUrl at RestSharp.RestClient.DoBuildUriValidations(IRestRequest request) at RestSharp.RestClient.BuildUri(IRestRequest request) at RestSharp.RestClient.ConfigureHttp(IRestRequest request) at RestSharp.RestClient.Execute(IRestRequest request, String httpMethod, Func3 getResponse)}`
The code i'm using is this: var restClient = new RestClient(); var restRequest = new RestRequest("http://dawa.aws.dk/regioner", Method.GET); IRestResponse restResponse = restClient.Execute(restRequest);
It's a public API so feel free to test the http call.
Best Regards
Bjarne
The text was updated successfully, but these errors were encountered:
This is nothing to do with the URL. You have to specify the base url for the RestClient. You should be using
var restClient = new RestClient("https://dawa.aws.dk");
var restRequest = new RestRequest("/regioner", Method.GET);
IRestResponse restResponse = restClient.Execute(restRequest);
When i try to use the code snippet below, i get this message:
{System.NullReferenceException: RestClient must contain a value for BaseUrl at RestSharp.RestClient.DoBuildUriValidations(IRestRequest request) at RestSharp.RestClient.BuildUri(IRestRequest request) at RestSharp.RestClient.ConfigureHttp(IRestRequest request) at RestSharp.RestClient.Execute(IRestRequest request, String httpMethod, Func
3 getResponse)}`The code i'm using is this:
var restClient = new RestClient(); var restRequest = new RestRequest("http://dawa.aws.dk/regioner", Method.GET); IRestResponse restResponse = restClient.Execute(restRequest);
It's a public API so feel free to test the http call.
Best Regards
Bjarne
The text was updated successfully, but these errors were encountered: